package com.dungeon.game;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.dungeon.game.Constants.Dungeon_event_code;
import com.dungeon.game.Constants.Equipment_type_code;
import com.dungeon.game.Constants.Monster_code;
import com.dungeon.game.Constants.Scenario_code;

public class Scenario implements Serializable{

	Scenario_code sc;

	public Scenario (Scenario_code _sc){
		sc = _sc;
	}

	public class ScenarioEvent implements Serializable{
		Dungeon_event_code code;
		// If a pause event:
		Double pause_s, respite_s; // or null
		// If monsters arriving:
		Monster_code mob_type;
		int n_of;
		// If a message:
		String text, image;
		// If gold or gems or a chest:
		Integer min, max;
		// If a checked:
		Integer locked_chance; // from 0 to 100
		// If a summoning or illusion trap:
		Integer max_level;
		// If an item:
		Equipment_type_code loot_type;
		double loot_chance;
		// If a sound:
		String sound;
	}

	ScenarioEvent make_mob_event(Monster_code _mob_type, int _n_of){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_MOBS;
		e.mob_type = _mob_type;
		e.n_of = _n_of;
		return e;
	}

	ScenarioEvent make_sound_event(String _sound){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_SOUND;
		e.sound = _sound;
		return e;
	}

	ScenarioEvent make_message_event(String _text, String _image){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_MESSAGE;
		e.text = _text;
		if (_image==null ||_image.equals(""))
			e.image = null;
		else
			e.image = _image;
		return e;
	}

	ScenarioEvent make_gold_event(int _min, int _max){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_GOLD;
		e.min = _min;
		e.max = _max;
		return e;
	}

	ScenarioEvent make_gems_event(int _min, int _max){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_GEMS;
		e.min = _min;
		e.max = _max;
		return e;
	}

	ScenarioEvent make_goldchest_event(int _locked_chance, int _min, int _max){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_GOLDCHEST;
		e.locked_chance = _locked_chance;
		e.min = _min;
		e.max = _max;
		return e;
	}

	ScenarioEvent make_gemschest_event(int _locked_chance, int _min, int _max){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_GEMSCHEST;
		e.locked_chance = _locked_chance;
		e.min = _min;
		e.max = _max;
		return e;
	}

	ScenarioEvent make_pause_event(Double _pause_s, Double _respite_s){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_PAUSE;
		e.pause_s = _pause_s;
		e.respite_s = _respite_s;
		return e;
	}

	ScenarioEvent make_random_loot_event(double chance, List<Equipment_type_code> loot_types){
		return make_loot_event(chance, loot_types.get(Campaignstate.randint(0, loot_types.size()-1)));
	}

	ScenarioEvent make_loot_event(double chance, Equipment_type_code _loot_type){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_LOOT;
		e.loot_chance = chance;
		e.loot_type = _loot_type;
		return e;
	}

	ScenarioEvent make_illusion_trap_event(int _max_level){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_ILLUSIONSRUNE;
		e.max_level = _max_level;
		return e;
	}

	ScenarioEvent make_illusion_event(int _max_level){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_ILLUSIONS;
		e.max_level = _max_level;
		return e;
	}

	ScenarioEvent make_summoning_trap_event(int _max_level){
		ScenarioEvent e = new ScenarioEvent();
		e.code = Dungeon_event_code.DE_SUMMONINGRUNE;
		e.max_level = _max_level;
		return e;
	}

	ScenarioEvent make_other_event(Dungeon_event_code _code){
		ScenarioEvent e = new ScenarioEvent();
		e.code = _code;
		return e;
	}

 	List<ScenarioEvent> downstairs(){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		s.add(make_pause_event(9999.0,2.0));
        s.add(make_other_event(Dungeon_event_code.DE_DOWNSTAIRS));
        s.add(make_pause_event(3.0,null));
		return s;
	}

 	List<ScenarioEvent> upstairs(){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		s.add(make_pause_event(9999.0,2.0));
        s.add(make_other_event(Dungeon_event_code.DE_UPSTAIRS));
        s.add(make_pause_event(3.0,null));
		return s;
	}

	List<ScenarioEvent> door(){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		s.add(make_pause_event(9999.0,1.5));
 		s.add(make_other_event(Dungeon_event_code.DE_DOOR));
	    s.add(make_pause_event(2.5,null));
		return s;
	}

	List<ScenarioEvent> locked_door(){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		s.add(make_pause_event(9999.0,1.5));
 		s.add(make_other_event(Dungeon_event_code.DE_LOCKEDDOOR));
	    s.add(make_pause_event(2.5,null));
		return s;
	}

	List<ScenarioEvent> win(){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		s.add(make_pause_event(9999.0,1.0));
 		s.add(make_other_event(Dungeon_event_code.DE_WIN));
	    s.add(make_pause_event(2.0,null));
	    s.add(make_other_event(Dungeon_event_code.DE_QUIT));
		return s;
	}

	List<Equipment_type_code> loot_options(int level){
		ArrayList<Equipment_type_code> options = new ArrayList<Equipment_type_code>();
		for (Equipment_type_code e : Equipment_type_code.values()){
			if (e.get_random_level()!=null && e.get_random_level()==level){
				for (int i=0; i<e.get_likelihood()*10; i++){
					options.add(e);
				}
			}
		}
		return options;
	}

	public static int getPoisson(double lambda) {
		  double L = Math.exp(-lambda);
		  double p = 1.0;
		  int k = 0;

		  do {
		    k++;
		    p *= Gamestate.w.rand.nextDouble();
		  } while (p > L);

		  return k - 1;
		}

	List<ScenarioEvent> make_trap_event(int level){
 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
 		if (level<=3){
			int choice = Gamestate.w.randint(0, 1);
			if (choice==0){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("The floor creaks...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(3.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_PIT));
				s.add(make_pause_event(2.0,null));
			} else if (choice==1){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You see something glowing on the floor...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(3.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_EXPLOSIVERUNE));
				s.add(make_pause_event(2.0,null));
			}
 		} else if (level==4){
			int choice = Gamestate.w.randint(0, 6);
			if (choice<=1){
				s.add(make_pause_event(0.2,null));
                s.add(make_message_event("The floor creaks...",""));
                s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
                s.add(make_pause_event(3.0,null));
                s.add(make_other_event(Dungeon_event_code.DE_PIT));
				s.add(make_pause_event(2.0,null));
			} else if (choice<=3){
				s.add(make_pause_event(0.2,null));
                s.add(make_message_event("You hear a quiet click...",""));
                s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
                s.add(make_pause_event(3.0,null));
                s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
				s.add(make_pause_event(2.0,null));
			} else if (choice<=5){
				s.add(make_pause_event(0.2,null));
                s.add(make_message_event("You see something glowing on the floor...",""));
                s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
                s.add(make_pause_event(3.0,null));
                s.add(make_summoning_trap_event(4));
				s.add(make_pause_event(2.0,null));
			} else {
				s.add(make_pause_event(0.2,null));
                s.add(make_message_event("You see something glowing on the floor...",""));
                s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
                s.add(make_pause_event(3.0,null));
                s.add(make_illusion_trap_event(4));
				s.add(make_pause_event(2.0,null));
			}
 		} else if (level==5){
			int choice = Gamestate.w.randint(0, 6);
			if (choice<=1){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You hear a quiet click...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
				s.add(make_pause_event(2.0,null));
			} else if (choice<=3){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("The floor creaks...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
			} else if (choice<=5){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You see something glowing on the floor...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(2.0,null));
	            s.add(make_summoning_trap_event(5));
				s.add(make_pause_event(2.0,null));
			} else if (choice==6){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You see something glowing on the floor...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(2.0,null));
	            s.add(make_illusion_trap_event(5));
				s.add(make_pause_event(2.0,null));
			}
 		} else if (level==6){
 			int choice = Gamestate.w.randint(0, 2);
			if (choice==0){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You hear a quiet click...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
				s.add(make_pause_event(2.0,null));
			} else if (choice==1){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("The floor creaks...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
			} else if (choice==2){
				if (Gamestate.w.randint(1,10)==10){
					s.add(make_pause_event(0.2,null));
					s.add(make_message_event("You see thick webs ahead...",""));
					s.add(make_pause_event(1.5,null));
					s.add(make_message_event("You are getting tangled up...",""));
		            s.add(make_other_event(Dungeon_event_code.DE_WEBTRAP));
					s.add(make_pause_event(2.0,null));
					s.add(make_message_event("Ugh! Giant spiders are emerging!",""));
					s.add(make_mob_event(Monster_code.MOB_BIG_SPIDER,6));
					s.add(make_pause_event(2.0,null));
				} else {
					s.add(make_pause_event(0.2,null));
					s.add(make_message_event("You see something glowing on the floor...",""));
					s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
					s.add(make_pause_event(1.5,null));
					s.add(make_summoning_trap_event(6));
					s.add(make_pause_event(2.0,null));
				}
			}
 		} else if (level>=7){
 			int choice = Gamestate.w.randint(0, 4);
			if (choice==0){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You hear a quiet click...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
				s.add(make_pause_event(2.0,null));
			} else if (choice==1){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("The floor creaks...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
			} else if (choice==2){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You see something glowing on the floor...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_summoning_trap_event(6));
				s.add(make_pause_event(2.0,null));
			} else if (choice==3){
				s.add(make_pause_event(0.2,null));
	            s.add(make_message_event("You smell sulphur...",""));
	            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
	            s.add(make_pause_event(1.5,null));
	            s.add(make_other_event(Dungeon_event_code.DE_FIRETRAP));
				s.add(make_pause_event(2.0,null));
			} else if (choice==4){
				if (Gamestate.w.randint(1,10)==10){
					s.add(make_pause_event(0.2,null));
					s.add(make_message_event("You see thick webs ahead...",""));
					s.add(make_pause_event(1.5,null));
					s.add(make_message_event("You are getting tangled up...",""));
		            s.add(make_other_event(Dungeon_event_code.DE_WEBTRAP));
					s.add(make_pause_event(2.0,null));
					s.add(make_message_event("Ugh! Giant spiders are emerging!",""));
					s.add(make_mob_event(Monster_code.MOB_BIG_SPIDER,6));
					s.add(make_pause_event(2.0,null));
				} else {
					s.add(make_pause_event(0.2,null));
					s.add(make_message_event("You see something glowing on the floor...",""));
					s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
					s.add(make_pause_event(1.5,null));
					s.add(make_other_event(Dungeon_event_code.DE_TELEPORTRUNE));
					s.add(make_pause_event(2.0,null));
				}
			}
 		}
		return s;
	}

	List<ScenarioEvent> make_encounter(double level){
		while (true){
	 		ArrayList<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
	 		ArrayList<Monster_code> m = new ArrayList<Monster_code>();
	 		ArrayList<Integer> n_of = new ArrayList<Integer>();
	 		ArrayList<Double> delays = new ArrayList<Double>();
	 		double sum_of_cubes = 0;
	 		double random_dungeon_frequency = 1;
	 		int fronts=1, backs=0, adds=0;
	 		if (Gamestate.w.rand.nextDouble() < 0.7)
	 			fronts=Gamestate.w.randint(1, 3);
	 		if (Gamestate.w.rand.nextDouble() < 0.7)
		 		backs=Gamestate.w.randint(1, 3);
	 		if (Gamestate.w.rand.nextDouble() < 0.7)
	 			adds=Gamestate.w.randint(1, 3);
	 		while (fronts>0){
	 			Monster_code this_m = Monster_code.values()[Gamestate.w.randint(0, Monster_code.values().length-1)];
	 			Enemies.Mob this_mob = Gamestate.e.create_mob(this_m);
	 			if (this_mob.prefer_back)
	 				continue;
	 			if (this_mob.never_encountered_randomly)
	 				continue;
	 			if (this_mob.level < level-2)
	 				continue;
	 			if (this_mob.level > level+1)
	 				continue;
	 			int this_n_of = 1;
	 			if (this_mob.found_in_groups && this_mob.level < level)
	 				this_n_of = Gamestate.w.randint(1, 3);
	 			for (int j=0; j<this_n_of; j++){
	 				sum_of_cubes = sum_of_cubes + Math.pow(this_mob.level,3);
	 			}
	 			fronts = fronts - 1;
 				m.add(this_m);
 				random_dungeon_frequency = random_dungeon_frequency * this_mob.random_dungeon_frequency;
 				n_of.add(this_n_of);
 				delays.add(0.0);
	 		}
	 		while (backs>0){
	 			Monster_code this_m = Monster_code.values()[Gamestate.w.randint(0, Monster_code.values().length-1)];
	 			Enemies.Mob this_mob = Gamestate.e.create_mob(this_m);
	 			if (!this_mob.prefer_back)
	 				continue;
	 			if (this_mob.never_encountered_randomly)
	 				continue;
	 			if (this_mob.level < level-2)
	 				continue;
	 			if (this_mob.level > level+1)
	 				continue;
	 			int this_n_of = 1;
	 			if (this_mob.found_in_groups && this_mob.level < level)
	 				this_n_of = Gamestate.w.randint(1, 3);
	 			for (int j=0; j<this_n_of; j++){
	 				sum_of_cubes = sum_of_cubes + Math.pow(this_mob.level,3);
	 			}
	 			backs = backs - 1;
 				m.add(this_m);
 				random_dungeon_frequency = random_dungeon_frequency * this_mob.random_dungeon_frequency;
 				n_of.add(this_n_of);
 				delays.add(0.5);
	 		}
	 		while (adds>0){
	 			Monster_code this_m = Monster_code.values()[Gamestate.w.randint(0, Monster_code.values().length-1)];
	 			Enemies.Mob this_mob = Gamestate.e.create_mob(this_m);
	 			if (this_mob.never_encountered_randomly)
	 				continue;
	 			if (this_mob.level < level-2)
	 				continue;
	 			if (this_mob.level > level+1)
	 				continue;
	 			int this_n_of = 1;
	 			if (this_mob.found_in_groups && this_mob.level < level)
	 				this_n_of = Gamestate.w.randint(1, 3);
	 			for (int j=0; j<this_n_of; j++){
	 				sum_of_cubes = sum_of_cubes + Math.pow(this_mob.level,3);
	 			}
	 			adds = adds - 1;
 				m.add(this_m);
 				random_dungeon_frequency = random_dungeon_frequency * this_mob.random_dungeon_frequency;
 				n_of.add(this_n_of);
 				delays.add((double)getPoisson(3.0));
	 		}
	 		double difficulty = Math.pow(sum_of_cubes,(1/3.0));
	 		if (difficulty > level-1 && difficulty <= level + 1.5*Math.pow(Gamestate.w.rand.nextDouble(),2)){
	 			if (Gamestate.w.rand.nextDouble() < 0.5*random_dungeon_frequency){
		 			for (int i=0; i<m.size(); i++){
		 				s.add(make_pause_event(delays.get(i),0.5));
		 				s.add(make_mob_event(m.get(i),n_of.get(i)));
		 			}
		 			return s;
	 			}
	 		}
		}
	}

	List<ScenarioEvent> make(){
    	List<ScenarioEvent> s = new ArrayList<ScenarioEvent>();
		if (sc==Scenario_code.SC_RANDOM_3){
	        s.addAll(downstairs());
 			s.add(make_pause_event(9999.9,2.0));
			int easy_encounters=Gamestate.w.randint(3,5);
	        for (int i=0; i<easy_encounters; i++){
	        	s.addAll(make_encounter(3));
	        	s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(4))
					s.addAll(make_trap_event(3));
            	s.addAll(door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
        	s.addAll(make_encounter(3.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,2);
			if (choice<=1){
				s.add(make_gold_event(10,30));
			} else if (choice==2){
				s.add(make_goldchest_event(30,20,40));
			}
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_RANDOM_4){
	        s.addAll(downstairs());
	        int easy_encounters=Gamestate.w.randint(2,4);
	        int hard_encounters=Gamestate.w.randint(2,3);
	        for (int i=0; i<easy_encounters; i++){
	        	s.addAll(make_encounter(3));
	        	s.add(make_pause_event(9999.0,2.0));
	            if (i==(easy_encounters-1)){
	    			s.add(make_gold_event(10,20));
	    	        s.addAll(downstairs());
	            } else {
					if (Gamestate.w.one_in(4))
						s.addAll(make_trap_event(3));
	            	s.addAll(door());
	            }
	        }
	        for (int i=0; i<hard_encounters-1; i++){
	        	s.addAll(make_encounter(4));
	            s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(4));
            	s.addAll(door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(make_encounter(4.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,4);
			if (choice<=1){
				s.add(make_gold_event(20,50));
			} else if (choice==2){
				s.add(make_gems_event(40,80));
			} else if (choice==3){
				s.add(make_goldchest_event(50,30,70));
			}
			s.add(make_random_loot_event(0.25,loot_options(4)));
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_RANDOM_5){
			s.addAll(downstairs());
	        int easy_encounters=Gamestate.w.randint(2,4);
	        int hard_encounters=Gamestate.w.randint(2,4);
	        for (int i=0; i<easy_encounters; i++){
	        	s.addAll(make_encounter(4));
	        	s.add(make_pause_event(9999.0,2.0));
	            if (i==(easy_encounters-1)){
	    			s.add(make_gold_event(20,40));
	    	        s.addAll(downstairs());
	            } else {
					if (Gamestate.w.one_in(4))
						s.addAll(make_trap_event(4));
	            	s.addAll(door());
	            }
	        }
	        for (int i=0; i<hard_encounters-1; i++){
		        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        	s.addAll(make_encounter(5));
	            s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(5));
				if (Gamestate.w.rand.nextDouble()<0.05)
	            	s.addAll(door());
				else
					s.addAll(locked_door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
        	s.addAll(make_encounter(5.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,12);
			if (choice<=3){
				s.add(make_gold_event(30,50));
			} else if (choice<=5){
				s.add(make_gems_event(40,80));
			} else if (choice<=7){
				s.add(make_goldchest_event(60,50,100));
			}
			s.add(make_random_loot_event(5.0/12.0,loot_options(5)));
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_RANDOM_6){
	        s.addAll(downstairs());
	        int easy_encounters=Gamestate.w.randint(3,5);
	        int hard_encounters=Gamestate.w.randint(2,4);
	        for (int i=0; i<easy_encounters; i++){
	        	s.addAll(make_encounter(5));
	        	s.add(make_pause_event(9999.0,2.0));
	            if (i==(easy_encounters-1)){
	    			s.add(make_gold_event(20,50));
	    			s.add(make_random_loot_event(3.0/12.0,loot_options(4)));
	    	        s.addAll(downstairs());
	            } else {
					if (Gamestate.w.one_in(4))
						s.addAll(make_trap_event(5));
	            	s.addAll(door());
	            }
	        }
	        for (int i=0; i<hard_encounters-1; i++){
		        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        	s.addAll(make_encounter(6));
	            s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(6));
				if (Gamestate.w.rand.nextDouble()<0.1)
	            	s.addAll(door());
				else
					s.addAll(locked_door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	    	s.addAll(make_encounter(6.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,12);
			if (choice<=3){
				s.add(make_gold_event(30,60));
			} else if (choice<=5){
				s.add(make_gems_event(50,100));
			} else if (choice<=7){
				s.add(make_goldchest_event(60,50,150));
			}
			s.add(make_random_loot_event(5.0/12.0,loot_options(5)));
			s.add(make_random_loot_event(5.0/12.0,loot_options(6)));
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_RANDOM_7){
	        s.addAll(downstairs());
	        int easy_encounters=Gamestate.w.randint(3,5);
	        int hard_encounters=Gamestate.w.randint(2,4);
	        for (int i=0; i<easy_encounters; i++){
	        	s.addAll(make_encounter(6));
	        	s.add(make_pause_event(9999.0,2.0));
	            if (i==(easy_encounters-1)){
	    			s.add(make_gold_event(30,60));
	    			s.add(make_random_loot_event(3.0/12.0,loot_options(5)));
	    	        s.addAll(downstairs());
	            } else {
					if (Gamestate.w.one_in(4))
						s.addAll(make_trap_event(6));
	            	s.addAll(door());
	            }
	        }
	        for (int i=0; i<hard_encounters-1; i++){
		        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        	s.addAll(make_encounter(7));
	            s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(7));
				if (Gamestate.w.rand.nextDouble()<0.1)
	            	s.addAll(door());
				else
					s.addAll(locked_door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	    	s.addAll(make_encounter(7.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,12);
			if (choice<=3){
				s.add(make_gold_event(50,100));
			} else if (choice<=5){
				s.add(make_gems_event(75,150));
			} else if (choice<=7){
				s.add(make_goldchest_event(80,100,200));
			}
			s.add(make_random_loot_event(5.0/12.0,loot_options(6)));
			s.add(make_random_loot_event(5.0/12.0,loot_options(7)));
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_RANDOM_8){
	        s.addAll(downstairs());
	        int easy_encounters=Gamestate.w.randint(3,4);
	        int hard_encounters=Gamestate.w.randint(3,4);
	        for (int i=0; i<easy_encounters; i++){
		        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        	s.addAll(make_encounter(7));
	        	s.add(make_pause_event(9999.0,2.0));
	            if (i==(easy_encounters-1)){
	    			s.add(make_gold_event(40,80));
	    			s.add(make_random_loot_event(3.0/12.0,loot_options(6)));
	    	        s.addAll(downstairs());
	            } else {
					if (Gamestate.w.one_in(4))
						s.addAll(make_trap_event(7));
	            	s.addAll(door());
	            }
	        }
	        for (int i=0; i<hard_encounters-1; i++){
		        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        	s.addAll(make_encounter(8));
	            s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(8));
				if (Gamestate.w.rand.nextDouble()<0.2)
	            	s.addAll(door());
				else
					s.addAll(locked_door());
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	    	s.addAll(make_encounter(8.5));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_pause_event(1.0,null));
			int choice = Gamestate.w.randint(0,9);
			if (choice<=3){
				s.add(make_gold_event(50,100));
			} else if (choice<=5){
				s.add(make_gems_event(75,150));
			} else if (choice<=7){
				s.add(make_goldchest_event(80,100,200));
			}
			s.add(make_random_loot_event(5.0/12.0,loot_options(7)));
			if (Campaignstate.one_in(5) && !Campaignstate.owns_item(Equipment_type_code.E_SHIELD_DEFENSE)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_SHIELD_DEFENSE));
			} else if (Campaignstate.one_in(5) && !Campaignstate.owns_item(Equipment_type_code.E_KRILL)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_KRILL));
			} else s.add(make_random_loot_event(5.0/12.0,loot_options(8)));
			s.add(make_pause_event(1.0,null));
		    s.add(make_pause_event(9999.0,0.1));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_TUTORIAL){
			s.add(make_other_event(Dungeon_event_code.DE_TUTORIAL));
			s.add(make_message_event("This is a dungeon adventure game. You can see your party of adventurers at the bottom of the screen. At the beginning of the game you have four characters, but later you will have six.",null));
			s.add(make_pause_event(4.0,null));
			s.add(make_message_event("Long-press on a character to see their stats and abilities.",null));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("You can move the characters around by dragging them from place to place.",null));
			s.add(make_pause_event(8.0,null));
			s.add(make_message_event("The front row characters are the most exposed to enemy attacks, especially in the middle of the front row.",null));
			s.add(make_pause_event(3.0,null));
	        s.addAll(door());
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("As your party explores the dungeon, enemies will appear at the top of the screen. Your adventurers will automatically fight them - using a melee attack if they are in the front row, or a missile attack if they are in the back row.",null));
			s.add(make_pause_event(5.0,null));
			s.add(make_mob_event(Monster_code.MOB_CENTIPEDE,1));
			s.add(make_message_event("Long-press on the centipede for more information about it.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("There are many tougher monsters, most of which the party will need your help to defeat.",null));
			s.add(make_pause_event(2.0,null));
	        s.addAll(door());
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_UGLY_THING,3));
			s.add(make_message_event("When an ugly thing gazes at you, tap on your wizard and use Counter: Fear.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_SNAKE,3));
			s.add(make_message_event("If a snake poisons you, one of your characters will go green. Tap on your priest, tell them to Cure Poison, and tap on the poisoned character.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("Your priest may cast Cure Poison even if you don't ask them to. A character with high Reflexes is more likely to do helpful things without being told.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("Have some of your characters been wounded (lost green bar)? Tell your priest to cast Cure Wounds, or tap on a character and tell them to drink a healing potion (if they have one).",null));
			s.add(make_pause_event(8.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
			s.add(make_message_event("When an orc says RAR, tap on your warrior and use Block.",null));
			s.add(make_pause_event(3.0,0.5));
			s.add(make_message_event("You can damage an orc by tapping on your wizard, telling them to use Zap, and tapping on the orc.",null));
			s.add(make_pause_event(9999.0,0.2));
			s.add(make_message_event("You can get money for killing enemies. Later you will be able to spend this on buying equipment and recruiting new characters.",null));
			s.add(make_pause_event(9999.0,4.0));
	        s.addAll(door());
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("Are some of your characters low on energy (blue bar)?",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Warriors regain energy over time.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("So do wizards, but more slowly.",null));
			s.add(make_pause_event(4.0,null));
			s.add(make_message_event("Rogues regain energy when you find some gold.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_gold_event(5,5));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("Gems are valuable but do not give your rogues any energy.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_gems_event(10,10));
			s.add(make_pause_event(4.0,null));
			s.add(make_message_event("Priests regain energy when you kill an evil enemy.",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WRETCH,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("Characters can also regain energy by drinking potions. Your priest may wish to drink a Blessed Potion now, if he hasn't already.",null));
			s.add(make_pause_event(4.0,null));
			s.add(make_message_event("Some higher level characters can also regain energy in other ways.",null));
			s.add(make_pause_event(1.0,null));
	        s.addAll(door());
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("In later dungeons you will find much nastier monsters.",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_BLACK_OGRE,1));
			s.add(make_mob_event(Monster_code.MOB_HELLHOUND,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_DWARF,1));
			s.add(make_pause_event(7.0,null));
			s.add(make_message_event("But you are not ready to fight these monsters yet.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_other_event(Dungeon_event_code.DE_CLEARMOBS));
			s.add(make_pause_event(2.0,null));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("There are also traps in the dungeon. Tell your rogue to Find Traps if you see a warning.",null));
			s.add(make_pause_event(2.0,null));
			s.addAll(make_trap_event(3));
			s.add(make_pause_event(2.0,null));
	        s.addAll(door());
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("There are over 100 kinds of items you can find. Here is one.",null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_SHIELD));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("When you get back to town, one of your characters can equip it. You may also want to buy some new equipment in the shops.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Some of your characters will also be able to learn new abilities. There are over 200 abilities in the game.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("After you are done, you might want to explore the caves near town. There are many more dungeons you will be able to explore after that...",null));
			s.add(make_pause_event(8.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_EASY){
			s.add(make_message_event("You have heard that there may be treasure to be found in a cave not far from your village.",null));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("You arrive at the cave.",null));
			s.add(make_pause_event(2.0,null));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You hear the clacking of bones!",null));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,2));
			s.add(make_pause_event(9999.0,0.5));
			s.add(make_gold_event(10,10));
			s.add(make_pause_event(2.0,null));
	        s.addAll(door());
			s.add(make_pause_event(2.0,null));
			s.addAll(make_trap_event(3));
			s.add(make_pause_event(2.0,null));
	        s.addAll(door());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("There is an angry hissing!",null));
			s.add(make_mob_event(Monster_code.MOB_SNAKE,2));
			s.add(make_mob_event(Monster_code.MOB_COBRA,1));
			s.add(make_pause_event(9999.0,0.5));
			s.add(make_gold_event(10,10));
			s.add(make_pause_event(2.0,null));
	        s.addAll(locked_door());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("A mob of orcs rushes at you!",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WRETCH,2));
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,2));
			s.add(make_pause_event(9999.0,0.5));
			s.add(make_gold_event(10,10));
			s.add(make_pause_event(2.0,null));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("It is slimy down here!",null));
			s.add(make_mob_event(Monster_code.MOB_OOZE,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_JELLY,1));
			s.add(make_pause_event(9999.0,0.5));
			s.add(make_gold_event(10,10));
			s.add(make_pause_event(2.0,null));
	        s.addAll(door());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You surprise a furtive band of troglodytes!",null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,3));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_SHAMAN,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,2));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have found some treasure!",null));
			s.add(make_gold_event(20,20));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_LONGSWORD,Equipment_type_code.E_ALDER_WAND,Equipment_type_code.E_MACE,Equipment_type_code.E_SHORTBOW)));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You have cleared out the cave!",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("There are dozens more dungeons to explore, and over 130 kinds of monsters to fight.",null));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("May you survive and prosper.",null));
			s.add(make_pause_event(3.0,null));
	    	s.addAll(win());
		} else if (sc==Scenario_code.SC_RED_DRAGON){
			s.add(make_message_event("No birds sing as you trek through the desolation surrounding the dragon's cave.",null));
			s.add(make_pause_event(4.0,null));
			s.add(make_message_event("You warily enter the cave mouth.",null));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("There are creepy crawlies in here.",null));
			s.add(make_mob_event(Monster_code.MOB_CENTIPEDE,1));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_mob_event(Monster_code.MOB_GIANT_ANT,3));
			s.add(make_pause_event(9999.9,2.0));
	        s.addAll(upstairs());
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("Something hisses from the shadows...",null));
			s.add(make_pause_event(9999.9,3.0));
			s.add(make_message_event("But it is just a snake.",null));
			s.add(make_mob_event(Monster_code.MOB_COBRA,2));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("Ghosts swarm around you...",null));
			s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,2));
			s.add(make_mob_event(Monster_code.MOB_BAT,2));
			s.add(make_pause_event(9999.9,2.0));
	        s.addAll(upstairs());
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("Is this Naga one of the dragon's worshippers?",null));
			s.add(make_mob_event(Monster_code.MOB_NAGA_WARRIOR,1));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("This unquiet spirit is one of the dragon's victims...",null));
			s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
			s.add(make_pause_event(9999.9,2.0));
	        s.addAll(upstairs());
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("You enter a large cavern...",null));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("You hear something slithering closer...",null));
			s.add(make_pause_event(9999.9,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
			s.add(make_other_event(Dungeon_event_code.DE_NOFLEE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_mob_event(Monster_code.MOB_YOUNG_RED_DRAGON ,1));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("It is defeated!",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You start searching through its hoard...",null));
			s.add(make_gold_event(200,200));
			s.add(make_pause_event(1.0,null));
			s.add(make_gems_event(100,100));
			s.add(make_pause_event(1.0,null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_DWARVEN_CHAINMAIL));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(6)));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(6)));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(6)));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("No longer will the dragon trouble your people!",null));
			s.add(make_pause_event(2.0,null));
	    	s.addAll(win());
		} else if (sc==Scenario_code.SC_CRYPT_1){
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("It is eerily quiet down here.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("Your lantern flickers, casting great shadows on the wall.",null));
			s.add(make_pause_event(2.0,null));
			for (int i=0; i<6; i++){
				s.add(make_pause_event(4.0,1.5));
				int random = Campaignstate.randint(1, 8);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_CENTIPEDE,Campaignstate.randint(1,3)));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_SNAKE,Campaignstate.randint(1,2)));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_GIANT_ANT,Campaignstate.randint(1,3)));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_COBRA,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_BAT,3));
			}
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("Your skin crawls...",null));
			s.add(make_pause_event(2.0,null));
            s.add(make_other_event(Dungeon_event_code.DE_PIT));
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You hear something stir in the dark. A shard of pottery suddenly flies at you.",null));
			s.add(make_sound_event("clunk"));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("The unquiet dead are moving!",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Skeletons clatter towards you, their skulls grinning horribly.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,3));
			s.add(make_pause_event(2.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			s.add(make_pause_event(2.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("A wave of chill washes over you.",null));
			s.add(make_sound_event("wind"));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_FROZEN_SPIRIT,2));
			s.add(make_pause_event(12.0,3.0));
			s.add(make_message_event("You hear a horrible shriek!",null));
			s.add(make_sound_event("scream"));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,2));
			s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
			s.add(make_pause_event(12.0,3.0));
			s.add(make_message_event("The darkness seems to gather about you!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_SPECTRE,2));
			s.add(make_pause_event(9999.0,3.0));
            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("A sallow figure rises to face you. It is a young practicioner of the dark arts, who you have disturbed at her work of animating more corpses.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("At her command, an ancient corpse lurches towards you.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
			s.add(make_mob_event(Monster_code.MOB_YOUNG_NECROMANCER,1));
			if (!Campaignstate.owns_item(Equipment_type_code.E_RELIQUARY)){
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_loot_event(1.0,Equipment_type_code.E_RELIQUARY));
			}
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You are glad to escape the haunted crypt!",null));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_CRYPT_2){
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("It is funereal in the ancient crypt.",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("You have no doubt that the treasures of the tomb will be guarded...",null));
			s.add(make_pause_event(2.0,null));
			for (int i=0; i<6; i++){
				s.add(make_pause_event(4.0,1.5));
				int random = Campaignstate.randint(1, 12);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_COBRA,Campaignstate.randint(1,3)));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_MILLIPEDE,Campaignstate.randint(1,3)));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_SKELETON,Campaignstate.randint(2,3)));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,Campaignstate.randint(1,2)));
				else if (random<=7)
					s.add(make_mob_event(Monster_code.MOB_BIG_KOBOLD,Campaignstate.randint(1,3)));
				else if (random<=9){
					s.add(make_mob_event(Monster_code.MOB_SKELETON,Campaignstate.randint(1,3)));
					s.add(make_mob_event(Monster_code.MOB_YOUNG_NECROMANCER,1));
				} else if (random<=10)
					s.add(make_mob_event(Monster_code.MOB_SCORPION,1));
				else if (random<=12)
					s.add(make_mob_event(Monster_code.MOB_BAT,3));
			}
			s.add(make_pause_event(9999.0,3.0));
            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You hear ghostly howls!",null));
			s.add(make_sound_event("scream"));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			for (int i=0; i<6; i++){
				s.add(make_pause_event(4.0,1.5));
				int random = Campaignstate.randint(1, 10);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_SKELETON,3));
				else if (random<=3)
					s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_SPECTRE,Campaignstate.randint(1,3)));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_FROZEN_SPIRIT,Campaignstate.randint(1,3)));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_WRAITH,Campaignstate.randint(1,2)));
			}
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,1));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,1));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Your lamp flickers and nearly goes out!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
			s.add(make_pause_event(12.0,3.0));
			s.add(make_message_event("The silence is oppressive...",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
			s.add(make_pause_event(12.0,3.0));
			boolean random = false;
			if (Campaignstate.one_in(2)) random = true;
			if (random){
				s.add(make_message_event("A wave of heat washes over you.",null));
				s.add(make_pause_event(0.5,null));
				s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
			} else {
				s.add(make_message_event("You hear a sound like fingernails on a blackboard!",null));
				s.add(make_pause_event(0.5,null));
				s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
			}
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("The dead are insulted by your presence!",null));
			if (Campaignstate.one_in(4)){
				s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,1));
			} else {
				s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
				s.add(make_mob_event(Monster_code.MOB_SKELETON,1));
				s.add(make_mob_event(Monster_code.MOB_SKELETON,1));
			}
			s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
			s.add(make_mob_event(Monster_code.MOB_SPECTRE,2));
			s.add(make_pause_event(20.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,3));
			s.add(make_pause_event(10.0,3.0));
			if (Campaignstate.one_in(6)){
				s.add(make_mob_event(Monster_code.MOB_BAN_SIDHE,1));
			} else if (Campaignstate.one_in(6)){
				s.add(make_mob_event(Monster_code.MOB_MUMMY,1));
				s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,2));
			} else {
				s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
				if (random){
					s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
				} else {
					s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
				}
				s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			}
			if (!Campaignstate.owns_item(Equipment_type_code.E_CURSE_SKULL)){
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_loot_event(1.0,Equipment_type_code.E_CURSE_SKULL));
			}
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_gemschest_event(80,100,100));
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("You are glad to escape the abode of the dead!",null));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_CRYPT_3){
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.addAll(downstairs());
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("It seems kinda quiet down here.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You don't see anything scary.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("Well that wasn't too hard.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,2));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
			s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,2));
			s.add(make_mob_event(Monster_code.MOB_SHADOWCASTER,1));
			s.add(make_mob_event(Monster_code.MOB_MUMMY,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
			s.add(make_message_event("WTF??!",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,2.0));
			if (Gamestate.w.one_in(2)){
				s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(1.0,null));
			}
			s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
			s.add(make_mob_event(Monster_code.MOB_SKELETON,2));
			s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
			s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You grimly fight your way through the dark halls.",null));
			boolean hard = false;
			for (int i=0; i<2; i++){
				int r = Gamestate.w.randint(1,7);
				if (r<=3) s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,1));
				else if (r<=5) s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
				else if (r<=6) s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
				else if (r<=7) s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
			}
			for (int i=0; i<2; i++){
				int r = Gamestate.w.randint(1,19);
				if (r<=2) s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
				else if (r<=4 && !hard) s.add(make_mob_event(Monster_code.MOB_SHADOWCASTER,1));
				else if (r<=5) s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
				else if (r<=7) s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
				else if (r<=8) s.add(make_mob_event(Monster_code.MOB_FROZEN_SPIRIT,1));
				else if (r<=10) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (r<=11) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
				else if (r<=12) s.add(make_mob_event(Monster_code.MOB_WINGED_SPECTRE,1));
				else if (r<=14 && !hard) {s.add(make_mob_event(Monster_code.MOB_NECROMANCER,1)); hard=true;}
				else if (r<=16 && !hard) {s.add(make_mob_event(Monster_code.MOB_BAN_SIDHE,1)); hard=true;}
				else if (r<=17) s.add(make_mob_event(Monster_code.MOB_MUMMY,1));
				else if (r<=19) s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
			}
			for (int i=0; i<4; i++){
				s.add(make_pause_event(5.0,1.0));
				int r = Gamestate.w.randint(1,24);
				if (r<=2) s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
				else if (r<=4 && !hard) s.add(make_mob_event(Monster_code.MOB_SHADOWCASTER,1));
				else if (r<=5) s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
				else if (r<=7) s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
				else if (r<=8) s.add(make_mob_event(Monster_code.MOB_FROZEN_SPIRIT,1));
				else if (r<=10) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (r<=11) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
				else if (r<=12) s.add(make_mob_event(Monster_code.MOB_WINGED_SPECTRE,1));
				else if (r<=14 && !hard) {s.add(make_mob_event(Monster_code.MOB_NECROMANCER,1)); hard=true;}
				else if (r<=16 && !hard) {s.add(make_mob_event(Monster_code.MOB_BAN_SIDHE,1)); hard=true;}
				else if (r<=17) s.add(make_mob_event(Monster_code.MOB_MUMMY,1));
				else if (r<=19) s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
				else if (r<=21) s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,1));
				else if (r<=23) s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
				else if (r<=24) s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
			}
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,2.0));
			if (Gamestate.w.one_in(2)){
				s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(1.0,null));
			}
			s.add(make_message_event("You have entered an unhallowed chamber.",null));
			s.add(make_sound_event("drama"));
			s.add(make_mob_event(Monster_code.MOB_BIG_WRAITH,1));
			for (int i=0; i<4; i++){
				int r = Gamestate.w.randint(1,24);
				if (r<=2) s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
				else if (r<=4) s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
				else if (r<=5) s.add(make_mob_event(Monster_code.MOB_FROZEN_SPIRIT,1));
				else if (r<=7) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (r<=9) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
				else if (r<=13) s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,1));
				else if (r<=15) s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
				else if (r<=17) s.add(make_mob_event(Monster_code.MOB_WIGHT,1));
				s.add(make_pause_event(5.0,1.0));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("This warrior's spirit may now rest in peace.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_gemschest_event(80,200,200));
			if (!Campaignstate.owns_item(Equipment_type_code.E_WRAITH_CLOAK)){
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_loot_event(1.0,Equipment_type_code.E_WRAITH_CLOAK));
			}
			s.add(make_pause_event(3.0,null));
			s.add(make_message_event("You dust yourselves off and head home.",null));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_TROGLODYTE_1){
			s.add(make_message_event("You have found a small cave behind some rocky outcrops...",null));
			s.add(make_pause_event(1.0,null));
	        s.addAll(downstairs());
            s.add(make_message_event("Indignant troglodytes rush to attack you!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,1));
			s.add(make_pause_event(4.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,2));
			s.add(make_pause_event(8.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,3));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_SHAMAN,1));
			s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        s.add(make_other_event(Dungeon_event_code.DE_PIT));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("You hear an angry hissing!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_SNAKE,2));
			s.add(make_pause_event(0.5,0.5));
			s.add(make_mob_event(Monster_code.MOB_COBRA,1));
			s.add(make_pause_event(6.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			s.add(make_pause_event(4.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_SNAKE,2));
			s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
	        s.add(make_message_event("A mob of troglodytes swarms out of the darkness!",null));
			s.add(make_other_event(Dungeon_event_code.DE_NOFLEE));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			for (int i=0; i<12; i++){
				s.add(make_pause_event(3.0,0.5));
				int random = Campaignstate.randint(1, 11);
				if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,1));
				else if (random<=10)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_SHAMAN,1));
				else if (random<=11)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			}
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("You have eradicated the troglodytes!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_gems_event(10,30));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_TROGLODYTE_2){
			s.add(make_message_event("You have entered an underground warren...",null));
			s.add(make_pause_event(1.0,null));
	        s.addAll(downstairs());
            s.add(make_message_event("Indignant troglodytes rush to attack you!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,3));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_SHAMAN,1));
			s.add(make_pause_event(3.0,null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
			s.add(make_pause_event(0.5,null));
			s.add(make_message_event("You hear an angry hissing!",null));
			s.add(make_sound_event("hiss"));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_COBRA,3));
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
	        s.add(make_message_event("A mob of troglodytes swarms out of the darkness!",null));
			s.add(make_pause_event(0.5,null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,2));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			for (int i=0; i<12; i++){
				s.add(make_pause_event(2.0,0.5));
				int random = Campaignstate.randint(1, 8);
				if (random<=3)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,1));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,1));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_SHAMAN,1));
				else if (random<=7)
					s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_COBRA,1));
			}
			s.add(make_pause_event(4.0,0.5));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_BEASTMASTER,1));
			s.add(make_pause_event(9999.9,2.0));
			s.add(make_message_event("You have eradicated the troglodytes!",null));
			if (!Campaignstate.owns_item(Equipment_type_code.E_DRAGONS_BANE)){
				s.add(make_pause_event(9999.0,3.0));
				s.add(make_message_event("You have found a powerful sword. Did the troglodytes know what a treasure they had found?",null));
				s.add(make_loot_event(1.0,Equipment_type_code.E_DRAGONS_BANE));
			}
			s.add(make_pause_event(9999.0,3.0));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_ORC_1){
			s.add(make_message_event("You stumble upon an orcish scout...",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_WOLF,1));
			s.add(make_pause_event(9999.0,5.0));
			s.add(make_message_event("More wolves appear, drawn by the sounds of struggle...",null));
			s.add(make_mob_event(Monster_code.MOB_WOLF,2));
			s.add(make_pause_event(9999.0,5.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have tracked down the orcish war band!",null));
			s.add(make_mob_event(Monster_code.MOB_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
			s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_AGITATOR,1));
			s.add(make_pause_event(11.0,0.5));
			for (int i=0; i<12; i++){
				s.add(make_pause_event(3.0,0.5));
				int random = Campaignstate.randint(1, 11);
				if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,1));
				else if (random<=11)
					s.add(make_mob_event(Monster_code.MOB_WOLF,1));
			}
			s.add(make_pause_event(9999.0,5.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You confront the leader of the war band!",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,2));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The battle is over. You heap the corpses into a pile and burn them!",null));
			s.add(make_pause_event(3.0,null));
			s.add(make_gems_event(10,30));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_ORC_2){
			s.add(make_message_event("You stumble upon an orcish scout...",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_WOLF,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("More wolves appear, drawn by the sounds of struggle...",null));
			s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_WOLF,2));
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have found the orcish encampment!",null));
			s.add(make_other_event(Dungeon_event_code.DE_NOFLEE));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("An orc with a peculiar weapon advances to do battle with you.",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WITH_MANCATCHER,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The orcs surge forward!",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
			s.add(make_pause_event(5.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_ORC_AGITATOR,1));
			for (int i=0; i<16; i++){
				s.add(make_pause_event(3.0,0.5));
				int random = Campaignstate.randint(1, 13);
				if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,1));
				else if (random<=9)
					s.add(make_mob_event(Monster_code.MOB_ORC_WITH_MANCATCHER,1));
				else if (random<=12)
					s.add(make_mob_event(Monster_code.MOB_WOLF,1));
				else if (random<=13)
					s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
				if (Campaignstate.one_in(3))
					s.add(make_mob_event(Monster_code.MOB_BAT,1));
			}
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("The orc leaders hurl themselves at you!",null));
			s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,2));
			s.add(make_mob_event(Monster_code.MOB_WOLF,3));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The battle is over. Spattered in green blood, you head home to tell the townsfolk the good news.",null));
			if (!Campaignstate.owns_item(Equipment_type_code.E_BELT_OF_SCALPS)){
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_loot_event(1.0,Equipment_type_code.E_BELT_OF_SCALPS));
			}
			s.add(make_pause_event(3.0,null));
			s.add(make_gems_event(40,100));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_ORC_3){
			s.add(make_message_event("You enter the orc cave...",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("The entry is guarded.",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,3));
			s.add(make_mob_event(Monster_code.MOB_WOLF,2));
			s.add(make_pause_event(5.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
			s.add(make_mob_event(Monster_code.MOB_WOLF,2));
			s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WITH_MANCATCHER,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,3));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You make your way further into the cave...",null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,2));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
			s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,2));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
			s.add(make_message_event("Smaller goblins toil unceasingly in the depths...",null));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_ORC_WRETCH,3));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_SLAVEMASTER,1));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_ORC_SLAVEMASTER,1));
			s.add(make_pause_event(9999.0,3.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
			s.add(make_message_event("Enemies fling themselves upon you!",null));
			s.add(make_mob_event(Monster_code.MOB_ORC_AGITATOR,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
			for (int i=0; i<10; i++){
				s.add(make_pause_event(3.0,0.5));
				int random = Campaignstate.randint(1, 11);
				if (random<=3)
					s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
				if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_ORC_SLAVEMASTER,1));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,1));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_ORC_WITH_MANCATCHER,1));
				else if (random<=7)
					s.add(make_mob_event(Monster_code.MOB_ORC_AGITATOR,1));
				else if (random<=9)
					s.add(make_mob_event(Monster_code.MOB_WOLF,1));
				else if (random<=10)
					s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
				else if (random<=11)
					s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
			}
			s.add(make_message_event("A great orc chieftain shoulders his way forward!",null));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_mob_event(Monster_code.MOB_ORC_BOSS,1));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("The battle is over. Spattered in green blood, you head home to tell the townsfolk the good news.",null));
			s.add(make_pause_event(2.0,null));
			if (!Campaignstate.owns_item(Equipment_type_code.E_CHAMPIONS_SWORD)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_CHAMPIONS_SWORD));
				s.add(make_pause_event(9999.0,1.0));
			}
			s.add(make_loot_event(1.0,Equipment_type_code.E_BELT_OF_SCALPS));
			s.add(make_pause_event(3.0,null));
			s.addAll(win());
	    } else if (sc==Scenario_code.SC_SWAMP_1){
			s.add(make_message_event("It is dismal in the swamp.",null));
			s.add(make_pause_event(2.0,null));
			for (int i=0; i<14; i++){
				s.add(make_pause_event(6.0-i/10.0,0.5));
				int random = Campaignstate.randint(1, 13+i/2);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_BIG_FROG,1));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_SNAKE,1));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_GIANT_FIREFLY,1));
				else if (random<=8)
					s.add(make_mob_event(Monster_code.MOB_GIANT_WASP,1));
				else if (random<=9)
					s.add(make_mob_event(Monster_code.MOB_COBRA,1));
				else if (random<=10)
					s.add(make_mob_event(Monster_code.MOB_PYTHON,1));
				else if (random<=11)
					s.add(make_mob_event(Monster_code.MOB_SCORPION,1));
				else if (Campaignstate.one_in(2))
					s.add(make_mob_event(Monster_code.MOB_JELLY,Campaignstate.randint(1, 1+i/5)));
				else
					s.add(make_mob_event(Monster_code.MOB_OOZE,Campaignstate.randint(1, 1+i/5)));
			}
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You drag yourself out of the squelching mire.",null));
			s.add(make_sound_event("splut"));
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	    	s.addAll(win());
	    } else if (sc==Scenario_code.SC_SWAMP_2){
			s.add(make_message_event("It is dreary in the swamp.",null));
			s.add(make_pause_event(2.0,null));
			for (int i=0; i<14; i++){
				s.add(make_pause_event(4.0-i/6.0,0.5));
				int random = Campaignstate.randint(1, 19);
				if (random<=1)
					s.add(make_mob_event(Monster_code.MOB_TURTLOID,1));
				else if (random<=3)
					s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_BASILISK,1));
				else if (random<=7)
					s.add(make_mob_event(Monster_code.MOB_GIANT_FIREFLY,1));
				else if (random<=10)
					s.add(make_mob_event(Monster_code.MOB_GIANT_WASP,1));
				else if (random<=12)
					s.add(make_mob_event(Monster_code.MOB_COBRA,1));
				else if (random<=14)
					s.add(make_mob_event(Monster_code.MOB_PYTHON,1));
				else if (random<=15)
					s.add(make_mob_event(Monster_code.MOB_SCORPION,1));
				else if (random<=16)
					s.add(make_mob_event(Monster_code.MOB_JELLY,Campaignstate.randint(1, 1+i/5)));
				else if (random<=18)
					s.add(make_mob_event(Monster_code.MOB_OOZE,Campaignstate.randint(1, 1+i/5)));
				else
					s.add(make_mob_event(Monster_code.MOB_LIME_JELLY,Campaignstate.randint(1, 1+i/5)));
			}
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You drag yourself out of the squelching mire.",null));
			s.add(make_sound_event("splut"));
			s.add(make_pause_event(2.0,null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	    	s.addAll(win());
	    } else if (sc==Scenario_code.SC_TROLL_1){
			s.add(make_message_event("You head for the famous Trollsbridge.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("On the road, you encounter some wandering enemies...",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_WOLF,3));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_GOBLIN,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_HALF_TROLL,1));
			s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_THUG,3));
			s.add(make_pause_event(9999.0,5.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You arrive at the river. There is no one here.",null));
			s.add(make_sound_event("extinguish"));
			s.add(make_pause_event(9999.0,5.0));
			s.add(make_message_event("You walk out onto the bridge. There is no one to be seen.",null));
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_message_event("A horrible troll jumps out from under the bridge. 'Who dares cross my bridge?' he yells.",null));
			s.add(make_sound_event("whoosh"));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_mob_event(Monster_code.MOB_TROLL,1));
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_message_event("Under the bridge, something gleams in the mud...",null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_ANTIQUE_SWORD));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You continue to the far side of the river - just because you can - and then return home.",null));
			s.add(make_pause_event(2.0,null));
	    	s.addAll(win());
	    } else if (sc==Scenario_code.SC_EXPLOSIVE_CAVE){
			s.add(make_message_event("You are passing through the woods when you hear a muffled explosion some distance away.",null));
			s.add(make_sound_event("bang"));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("More explosions follow.",null));
			s.add(make_sound_event("bang"));
			s.add(make_pause_event(1.5,null));
			s.add(make_sound_event("bang"));
			s.add(make_pause_event(1.5,null));
			s.add(make_message_event("A bear lumbers towards you, obviously trying to escape the loud noise. It rears up and attack you.",null));
			s.add(make_mob_event(Monster_code.MOB_BEAR,1));
			s.add(make_pause_event(2.0,0.5));
			s.add(make_mob_event(Monster_code.MOB_BLAST_SPORE,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You can see more woodland creatures fleeing towards you, followed by more of the strange globular flying balls.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_BLAST_SPORE,2));
			s.add(make_pause_event(1.0,null));
			for (int i=0; i<12; i++){
				s.add(make_pause_event(3.0,null));
				int random = Campaignstate.randint(1, 12);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_BEAR,1));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_WOLF,1));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_SNAKE,1));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_BAD_CAT,1));
				else
					s.add(make_mob_event(Monster_code.MOB_BLAST_SPORE,Campaignstate.randint(1,2)));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The battle seems to be over. Your ears are still ringing!",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_HUNTERS_SASH));
			s.add(make_pause_event(3.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_PARTY_1){
	        s.addAll(downstairs());
	        s.addAll(make_encounter(3));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(3));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(4));
	        s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have met some old enemies - a rival adventuring party!",null));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_THUG,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_ARCHER,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
			s.add(make_mob_event(Monster_code.MOB_YOUNG_NECROMANCER,1));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have routed your rivals this time, but you have a feeling you will see them again.",null));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_SHORTBOW,Equipment_type_code.E_ALDER_WAND,Equipment_type_code.E_MACE)));
		    s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_PARTY_2){
	        s.addAll(downstairs());
	        s.addAll(make_encounter(3));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(4));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(5));
	        s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have met some old enemies - a rival adventuring party!",null));
			s.add(make_mob_event(Monster_code.MOB_DARK_ELF_SWORDSMAN,1));
			s.add(make_mob_event(Monster_code.MOB_FOREIGN_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_ENCHANTER,1));
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_CROSSBOWMAN,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_ELF_DRUID,1));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have routed your rivals this time, but you have a feeling you will see them again.",null));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_ASSASSINS_BLADE,Equipment_type_code.E_YEW_WAND,Equipment_type_code.E_MAGIC_SLING,Equipment_type_code.E_HOODED_CLOAK,Equipment_type_code.E_GNOMISH_CROSSBOW)));
		    s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_PARTY_3){
	        s.addAll(downstairs());
	        s.addAll(make_encounter(4));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(5));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(6));
	        s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have met some old enemies - a rival adventuring party!",null));
			s.add(make_mob_event(Monster_code.MOB_BLACK_KNIGHT,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_DWARF,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_ELF_ARCHER,1));
			s.add(make_mob_event(Monster_code.MOB_MAGE,1));
			s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have routed your rivals this time, but you have a feeling you will see them again.",null));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_CUTLASS));
		    s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_PARTY_4){
	        s.addAll(downstairs());
	        s.addAll(make_encounter(6));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(7));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(7));
	        s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have met some old enemies - a rival adventuring party!",null));
			s.add(make_mob_event(Monster_code.MOB_CHAMPION,1));
			s.add(make_mob_event(Monster_code.MOB_BERSERKER,1));
			s.add(make_mob_event(Monster_code.MOB_ASSASSIN,1));
			s.add(make_mob_event(Monster_code.MOB_PYROMANCER,1));
			s.add(make_mob_event(Monster_code.MOB_SNIPER,1));
			s.add(make_mob_event(Monster_code.MOB_SUMMONER,1));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have routed your rivals, perhaps for the last time.",null));
		    s.add(make_pause_event(9999.0,2.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_ASSASSINS_BLADE));
		    s.add(make_pause_event(9999.0,1.0));
			if (!Campaignstate.owns_item(Equipment_type_code.E_CHAMPIONS_SWORD)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_CHAMPIONS_SWORD));
			} else {
				s.add(make_loot_event(1.0,Equipment_type_code.E_MIRRORED_SHIELD));
			}
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_GREAT_AXE));
		    s.add(make_pause_event(9999.0,1.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_RED_STAFF));
		    s.add(make_pause_event(9999.0,1.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_DRAGON_HORN_BOW));
		    s.add(make_pause_event(9999.0,1.0));
			s.add(make_loot_event(1.0,Equipment_type_code.E_FAMILIAR_IMP));
		    s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_DOPPELGANGER_PARTY){
	        s.addAll(downstairs());
			s.add(make_message_event("You have heard that some tricky little creatures have occupied this cave.",null));
		    s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.addAll(make_encounter(5));
	        s.add(make_pause_event(9999.0,2.0));
	        s.addAll(make_encounter(5));
	        s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLEE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You see six funny little beings standing before you.",null));
	        s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_DOPPELGANGER,6));
	        s.add(make_pause_event(0.2,null));
			s.add(make_message_event("One by one they start to change to resemble... you!",null));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have faced yourself and won!",null));
		    s.add(make_pause_event(9999.0,2.0));
			if (!Campaignstate.owns_item(Equipment_type_code.E_MIRRORED_HELM)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_MIRRORED_HELM));
			}
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_LABYRINTH){
	        s.addAll(door());
			s.add(make_message_event("You have entered the labyrinth.",null));
	        int encounters=Gamestate.w.randint(6,10);
	        for (int i=0; i<encounters; i++){
	        	s.add(make_pause_event(9999.0,3.0));
	        	List<Monster_code> choices = Arrays.asList(Monster_code.MOB_COBRA, Monster_code.MOB_SKELETON, Monster_code.MOB_GOBLIN, Monster_code.MOB_JELLY, Monster_code.MOB_WOLF, Monster_code.MOB_BIG_KOBOLD, Monster_code.MOB_ORC_WARRIOR, Monster_code.MOB_PYTHON, Monster_code.MOB_MILLIPEDE, Monster_code.MOB_FROZEN_SPIRIT, Monster_code.MOB_SCORPION, Monster_code.MOB_SPECTRE, Monster_code.MOB_ORC_WITH_MANCATCHER, Monster_code.MOB_THUG, Monster_code.MOB_BEETLE, Monster_code.MOB_OOZE, Monster_code.MOB_WRAITH, Monster_code.MOB_BIG_SPIDER, Monster_code.MOB_WIGHT, Monster_code.MOB_CLAY_GOLEM, Monster_code.MOB_BAD_CAT, Monster_code.MOB_HALF_TROLL, Monster_code.MOB_GUARDIAN_EYE);
	        	s.add(make_mob_event(choices.get(Gamestate.w.randint(0,choices.size()-1)),1));
	        	s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(3)){
					s.addAll(make_trap_event(Gamestate.w.randint(4, 5)));
				} else if (Gamestate.w.one_in(12)){
					s.add(make_sound_event("cancel"));
					s.add(make_message_event("You seem to have come back to the entrance!",null));
					s.add(make_pause_event(3.0,null));
				    s.add(make_other_event(Dungeon_event_code.DE_QUIT));
				} else if (Gamestate.w.one_in(3)){
					s.add(make_message_event("The maze twists and turns interminably.",null));
					s.add(make_pause_event(1.0,null));
				}
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have found an open space in the middle of the labyrinth.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_MINOTAUR,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have slain the guardian of the labyrinth!",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_PLUMED_HELM,Equipment_type_code.E_HOODED_CLOAK,Equipment_type_code.E_VISORED_HELM,Equipment_type_code.E_CHAIN_UNDERVEST,Equipment_type_code.E_BRACERS_OF_DEFENSE,Equipment_type_code.E_TREASURE_MAP,Equipment_type_code.E_GLOWING_PHIAL,Equipment_type_code.E_HOLY_WATER_SPRINKLER)));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You painstakingly retrace your steps until you find the exit.",null));
			s.add(make_pause_event(3.0,null));
	        s.addAll(win());
	    /* }  else if (sc==Scenario_code.SC_ALEX){
			s.add(make_message_event("This is Alex's dungeon.",null));
			s.add(make_sound_event("alex howl"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_BEAR,3));
			s.add(make_pause_event(9999.0,2.0));
            s.add(make_message_event("You smell sulphur...",""));
            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
            s.add(make_pause_event(1.5,null));
            s.add(make_other_event(Dungeon_event_code.DE_FIRETRAP));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_BERSERKER,2));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(upstairs());
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_BABY_RED_DRAGON,3));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(downstairs());
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLEE));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_WAR_TROLL,1));
			s.add(make_mob_event(Monster_code.MOB_VORTEX,1));
			s.add(make_mob_event(Monster_code.MOB_WHIRLWIND,1));
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
            s.add(make_message_event("The floor creaks...",""));
            s.add(make_other_event(Dungeon_event_code.DE_CHECKTRAPS));
            s.add(make_pause_event(2.0,null));
            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
			s.add(make_mob_event(Monster_code.MOB_TROLL,1));
			s.add(make_mob_event(Monster_code.MOB_WARLOCK,1));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_BLUE_ROBE,Equipment_type_code.E_MIRRORED_SHIELD,Equipment_type_code.E_DWARVEN_SHIELD,Equipment_type_code.E_RED_ROBE,Equipment_type_code.E_HALBERD)));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win()); */
		} else if (sc==Scenario_code.SC_SNAKE_1){
	        s.addAll(downstairs());
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You hear rustling.",null));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You step on something that wriggles under your foot!",null));
	        s.add(make_pause_event(0.5,null));
	        for (int i=0; i<5; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_PIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
	        for (int i=0; i<3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
			s.add(make_message_event("My, there sure are a shitload of snakes down here!",null));
	        for (int i=0; i<3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
			s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
			s.add(make_mob_event(Monster_code.MOB_BIG_SNAKE,1));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You finished kicking snake ass!",null));
			s.add(make_gold_event(20,50));
			s.add(make_loot_event(1.0, Equipment_type_code.E_POISON_ARROWS));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_SNAKE_2){
	        s.addAll(downstairs());
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The odds are there's a metric f*^(&ton of snakes down here",null));
	        s.add(make_pause_event(0.5,null));
	        for (int i=0; i<3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
			s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_PRIEST,1));
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_PIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
	        for (int i=0; i<3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
			s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
	        for (int i=0; i<3; i++){
	        	options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
        	options = Arrays.asList(Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
			s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        for (int i=0; i<2; i++){
	        	options = Arrays.asList(Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
			s.add(make_mob_event(Monster_code.MOB_NAGA_PRIESTESS,1));
			s.add(make_mob_event(Monster_code.MOB_NAGA_WARRIOR,2));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You don't mind if you never see another snake!",null));
			s.add(make_gold_event(40,80));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_GUERDON,Equipment_type_code.E_SHINING_ICON,Equipment_type_code.E_POTION_BELT)));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_SNAKE_3){
	        s.addAll(downstairs());
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("This seems to be kitted out as some kind of temple to the reptile gods.",null));
	        s.add(make_pause_event(2.0,null));
	        for (int i=0; i<3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
			s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
			s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_PIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
	        for (int i=0; i<3; i++){
	        	options = Arrays.asList(Monster_code.MOB_COBRA,Monster_code.MOB_SNAKE,Monster_code.MOB_PYTHON);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
        	options = Arrays.asList(Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
			s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        for (int i=0; i<2; i++){
	        	options = Arrays.asList(Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.addAll(downstairs());
	        if (Gamestate.w.one_in(3)){
				s.add(make_pause_event(2.0,null));
	            s.add(make_other_event(Dungeon_event_code.DE_SPIKEDPIT));
				s.add(make_pause_event(2.0,null));
	        } else {
				s.add(make_pause_event(2.0,null));
	        }
			s.add(make_message_event("The priestess is furious that you dare to intrude here!",null));
	        for (int i=0; i<2; i++){
	        	options = Arrays.asList(Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE,Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE,Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
			s.add(make_mob_event(Monster_code.MOB_NAGA_PRIESTESS,1));
	        s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.addAll(downstairs());
			s.add(make_message_event("The queen of the snakes crawls forth, vowing revenge on all warm-blooded creatures.",null));
			s.add(make_sound_event("drama"));
			s.add(make_mob_event(Monster_code.MOB_SNAKE_BOSS,1));
			s.add(make_pause_event(2.0,null));
	        for (int i=0; i<2; i++){
	        	options = Arrays.asList(Monster_code.MOB_NAGA_PRIESTESS,Monster_code.MOB_NAGA_PRIESTESS,Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE,Monster_code.MOB_BASILISK,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_BIG_SNAKE,Monster_code.MOB_BABY_RED_DRAGON,Monster_code.MOB_BABY_GREEN_DRAGON,Monster_code.MOB_BABY_BLUE_DRAGON,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_NAGA_WARRIOR);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("So much for the reptile gods!",null));
	        s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("No wonder the dinosaurs all died out...",null));
	        s.add(make_pause_event(9999.0,2.0));
			s.add(make_gold_event(200,400));
			if (!Campaignstate.owns_item(Equipment_type_code.E_MEDUSA_GIRDLE)){
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_loot_event(1.0,Equipment_type_code.E_MEDUSA_GIRDLE));
			}
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_PYRAMID_1){
	        s.addAll(downstairs());
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        int n_easy_encounters = Gamestate.w.randint(3, 5);
	        int n_hard_encounters = Gamestate.w.randint(2, 3);
	        for (int i=0; i<n_easy_encounters; i++){
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(4));
				else {
					int e = Gamestate.w.randint(1,6);
					if (e==1){
						s.add(make_mob_event(Monster_code.MOB_BEETLE,2));
					} else if (e==2){
						s.add(make_mob_event(Monster_code.MOB_COBRA,3));
					} else if (e==3){
						s.add(make_mob_event(Monster_code.MOB_SKELETON,3));
						s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
					} else if (e==4){
						s.add(make_mob_event(Monster_code.MOB_SCORPION,2));
					} else if (e==5){
						s.add(make_mob_event(Monster_code.MOB_THUG,3));
					} else if (e==6){
						s.add(make_mob_event(Monster_code.MOB_FOREIGN_WARRIOR,1));
					}
				}
				s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(4)){
			        s.addAll(downstairs());
				} else if (Gamestate.w.one_in(3)){
			        s.addAll(upstairs());
				} else if (Gamestate.w.one_in(2)){
			        s.addAll(door());
				} else {
			        s.addAll(locked_door());
				}
	        }
	        for (int i=0; i<n_hard_encounters; i++){
				if (Gamestate.w.one_in(3))
					s.addAll(make_trap_event(6));
				else {
					int e = Gamestate.w.randint(1,6);
					if (e==1){
						s.add(make_mob_event(Monster_code.MOB_BEETLE,6));
					} else if (e==2){
						s.add(make_mob_event(Monster_code.MOB_SCORPION,3));
						s.add(make_mob_event(Monster_code.MOB_COBRA,3));
					} else if (e==3){
						s.add(make_mob_event(Monster_code.MOB_SKELETON,3));
						s.add(make_mob_event(Monster_code.MOB_SHADOW,2));
						s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					} else if (e==4){
						s.add(make_mob_event(Monster_code.MOB_WIGHT,2));
						s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
						s.add(make_mob_event(Monster_code.MOB_POLTERGEIST,1));
					} else if (e==5){
						s.add(make_mob_event(Monster_code.MOB_SHADOW,3));
					}
				}
				s.add(make_pause_event(9999.0,2.0));
				if (Gamestate.w.one_in(4)){
			        s.addAll(downstairs());
				} else if (Gamestate.w.one_in(3)){
			        s.addAll(upstairs());
				} else if (Gamestate.w.one_in(2)){
			        s.addAll(door());
				} else {
			        s.addAll(locked_door());
				}
	        }
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        for (int i=1; i<=5; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_POLTERGEIST,Monster_code.MOB_COBRA,Monster_code.MOB_BEETLE,Monster_code.MOB_SKELETON,Monster_code.MOB_SCORPION,Monster_code.MOB_WRAITH,Monster_code.MOB_MUTE_GHOST,Monster_code.MOB_SHADOW,Monster_code.MOB_WIGHT,Monster_code.MOB_THUG,Monster_code.MOB_FOREIGN_WARRIOR);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
			s.add(make_mob_event(Monster_code.MOB_MUMMY,1));
	        for (int i=1; i<=3; i++){
	        	List<Monster_code> options = Arrays.asList(Monster_code.MOB_POLTERGEIST,Monster_code.MOB_COBRA,Monster_code.MOB_BEETLE,Monster_code.MOB_SKELETON,Monster_code.MOB_SCORPION,Monster_code.MOB_WRAITH,Monster_code.MOB_MUTE_GHOST,Monster_code.MOB_SHADOW,Monster_code.MOB_WIGHT,Monster_code.MOB_THUG,Monster_code.MOB_FOREIGN_WARRIOR);
				s.add(make_mob_event(options.get(Gamestate.w.randint(0,options.size()-1)),1));
	        }
	        s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("You loot the sarcophagus!",null));
			s.add(make_gold_event(20,40));
			s.add(make_gems_event(20,40));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_FLASK_OF_ELIXIR,Equipment_type_code.E_PEARL_AMULET,Equipment_type_code.E_AMULET_OF_WARDING)));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The enigmatic Mummy is defeated. Carnarvon is avenged!",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_WIZARD_TOWER_1){
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You rock up to the wizard's house.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(locked_door());
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(upstairs());
			for (int i=0; i<3; i++){
				s.add(make_pause_event(9999.0,1.0));
				if (Gamestate.w.one_in(3)){
					int j = Gamestate.w.randint(1, 4);
					if (j==1) s.add(make_other_event(Dungeon_event_code.DE_TELEPORTRUNE));
					else if (j==2) s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
					else if (j==3) s.add(make_summoning_trap_event(5));
					else if (j==4) s.add(make_illusion_trap_event(5));
					s.add(make_pause_event(9999.0,2.0));
				} else if (Gamestate.w.one_in(2)){
					int j = Gamestate.w.randint(1, 9);
					if (j==1) s.add(make_message_event("This looks like some kind of library.",null));
					else if (j==2) s.add(make_message_event("There are alembics and curcurbits here.",null));
					else if (j==3) s.add(make_message_event("This must be where the wizard sleeps.",null));
					else if (j==4) s.add(make_message_event("Something is bubbling in a retort on the bench. You sweep it to the ground with your sword.",null));
					else if (j==5) s.add(make_message_event("A malevolent homunculus peers at you from inside a glass tube.",null));
					else if (j==6) s.add(make_message_event("A telescope points out an open window. Here the wizard must study the stars.",null));
					else if (j==7) s.add(make_message_event("Someone has been copying out manuscripts in this scriptorium.",null));
					else if (j==8) s.add(make_message_event("This storeroom is full of peculiar magical stuffs.",null));
					else if (j==9) s.add(make_message_event("The air seems to crackle with magical energies.",null));
				}
				int j = Gamestate.w.randint(1, 6);
				if (j<=2) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
				else if (j==3) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
				else if (j==4) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (j==5) s.add(make_mob_event(Monster_code.MOB_BAD_CAT,1));
				else if (j==6) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				s.add(make_pause_event(1.0,0.5));
				j = Gamestate.w.randint(1, 7);
				if (j==1) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
				else if (j==2) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
				else if (j<=4) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				else if (j==5) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
				else if (j==6) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
				else if (j==7) s.add(make_mob_event(Monster_code.MOB_RAVEN,1));
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_gold_event(10,30));
				s.addAll(upstairs());
			}
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have surprised the wizard at his work! He stands up and looks menacingly at you.",null));
			s.add(make_sound_event("hmmm"));
			s.add(make_pause_event(9999.0,1.0));
			for (int i=1; i<Gamestate.w.randint(2, 4); i++){
				int j = Gamestate.w.randint(1, 8);
				if (j<=2) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				else if (j==3) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
				else if (j==4) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
				else if (j==5) s.add(make_mob_event(Monster_code.MOB_RAVEN,1));
				else if (j==6) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				else if (j<=8) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
			}
			if (Gamestate.w.one_in(4)){
				s.add(make_mob_event(Monster_code.MOB_ILLUSIONIST,1));
			} else {
				s.add(make_mob_event(Monster_code.MOB_MAGE,1));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_GNARLED_STAFF,Equipment_type_code.E_DUELLISTS_BRACERS,Equipment_type_code.E_WIZARDS_HAT,Equipment_type_code.E_MAGE_KNIFE)));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_WIZARD_TOWER_2){
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You arrive at the evil wizard's tower. He's not expecting you.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(locked_door());
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(upstairs());
			for (int i=0; i<3; i++){
				s.add(make_pause_event(9999.0,1.0));
				if (Gamestate.w.one_in(3)){
					int j = Gamestate.w.randint(1, 5);
					if (j==1) s.add(make_other_event(Dungeon_event_code.DE_TELEPORTRUNE));
					else if (j==2) s.add(make_other_event(Dungeon_event_code.DE_FIRETRAP));
					else if (j==3) s.add(make_other_event(Dungeon_event_code.DE_GASTRAP));
					else if (j==4) s.add(make_summoning_trap_event(6));
					else if (j==5) s.add(make_illusion_trap_event(6));
					s.add(make_pause_event(9999.0,2.0));
				} else if (Gamestate.w.one_in(2)){
					int j = Gamestate.w.randint(1, 9);
					if (j==1) s.add(make_message_event("This looks like some kind of library.",null));
					else if (j==2) s.add(make_message_event("There are alembics and curcurbits here.",null));
					else if (j==3) s.add(make_message_event("This must be where the wizard sleeps.",null));
					else if (j==4) s.add(make_message_event("Something is bubbling in a retort on the bench. You sweep it to the ground with your sword.",null));
					else if (j==5) s.add(make_message_event("A malevolent homunculus peers at you from inside a glass tube.",null));
					else if (j==6) s.add(make_message_event("A telescope points out an open window. Here the wizard must study the stars.",null));
					else if (j==7) s.add(make_message_event("Someone has been copying out manuscripts in this scriptorium.",null));
					else if (j==8) s.add(make_message_event("This storeroom is full of peculiar magical stuffs.",null));
					else if (j==9) s.add(make_message_event("The air seems to crackle with magical energies.",null));
				}
				for (int k=1; k<=Gamestate.w.randint(1, 3); k++){
					int j = Gamestate.w.randint(1, 8);
					if (j<=2) s.add(make_mob_event(Monster_code.MOB_STONE_GOLEM,1));
					else if (j<=4) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
					else if (j==5) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					else if (j==6) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
					else if (j==7) s.add(make_mob_event(Monster_code.MOB_BAD_CAT,1));
					else if (j==8) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				}
				s.add(make_pause_event(1.0,0.5));
				for (int k=1; k<=Gamestate.w.randint(1, 3); k++){
					int j = Gamestate.w.randint(1, 10);
					if (j==1) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					else if (j==2) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
					else if (j<=4) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
					else if (j==5) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
					else if (j==6) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
					else if (j==7) s.add(make_mob_event(Monster_code.MOB_EYE_OF_NEGATION,1));
					else if (j==8) s.add(make_mob_event(Monster_code.MOB_YOUNG_NECROMANCER,1));
					else if (j<=10) s.add(make_mob_event(Monster_code.MOB_MAGE,1));
				}
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_gold_event(20,40));
				s.addAll(upstairs());
			}
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have disturbed the wizard at his work! He stands up and glowers at you.",null));
			s.add(make_sound_event("hmmm"));
			s.add(make_pause_event(9999.0,1.0));
			for (int i=1; i<Gamestate.w.randint(2,4); i++){
				int j = Gamestate.w.randint(1, 9);
				if (j<=2) s.add(make_mob_event(Monster_code.MOB_STONE_GOLEM,1));
				else if (j<=4) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
				else if (j==5) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				else if (j==6) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				else if (j==7) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
				else if (j==8) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
				else if (j==9) s.add(make_mob_event(Monster_code.MOB_EYE_OF_NEGATION,1));
			}
			if (Gamestate.w.one_in(3)){
				s.add(make_mob_event(Monster_code.MOB_SUMMONER,1));
			} else {
				s.add(make_mob_event(Monster_code.MOB_WARLOCK,1));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_RED_ROBE,Equipment_type_code.E_BLUE_ROBE,Equipment_type_code.E_BRACERS_OF_DEFENSE,Equipment_type_code.E_FAMILIAR_IMP)));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_WIZARD_TOWER_3){
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You and all your Facebook friends crash the party!",null));
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(locked_door());
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(upstairs());
			for (int i=0; i<3; i++){
				s.add(make_pause_event(9999.0,1.0));
				if (Gamestate.w.one_in(3)){
					int j = Gamestate.w.randint(1, 4);
					if (j==1) s.add(make_other_event(Dungeon_event_code.DE_TELEPORTRUNE));
					else if (j==2) s.add(make_other_event(Dungeon_event_code.DE_FIRETRAP));
					else if (j==3) s.add(make_summoning_trap_event(7));
					else if (j==4) s.add(make_illusion_trap_event(7));
					s.add(make_pause_event(9999.0,2.0));
				} else if (Gamestate.w.one_in(2)){
					int j = Gamestate.w.randint(1, 9);
					if (j==1) s.add(make_message_event("This looks like some kind of library.",null));
					else if (j==2) s.add(make_message_event("There are alembics and curcurbits here.",null));
					else if (j==3) s.add(make_message_event("This must be where the wizard sleeps.",null));
					else if (j==4) s.add(make_message_event("Something is bubbling in a retort on the bench. You sweep it to the ground with your sword.",null));
					else if (j==5) s.add(make_message_event("A malevolent homunculus peers at you from inside a glass tube.",null));
					else if (j==6) s.add(make_message_event("A telescope points out an open window. Here the wizard must study the stars.",null));
					else if (j==7) s.add(make_message_event("Someone has been copying out manuscripts in this scriptorium.",null));
					else if (j==8) s.add(make_message_event("This storeroom is full of peculiar magical stuffs.",null));
					else if (j==9) s.add(make_message_event("The air seems to crackle with magical energies.",null));
				}
				boolean hard = false;
				for (int k=1; k<=Gamestate.w.randint(1, 3); k++){
					int j = Gamestate.w.randint(1, 11);
					if (j<=2 && !hard) s.add(make_mob_event(Monster_code.MOB_STONE_GOLEM,1));
					else if (j<=4) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
					else if (j==5) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					else if (j==6) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
					else if (j==7) s.add(make_mob_event(Monster_code.MOB_BAD_CAT,1));
					else if (j==8 && !hard) s.add(make_mob_event(Monster_code.MOB_IMP,1));
					else if (j==9 && !hard){ s.add(make_mob_event(Monster_code.MOB_ICE_DEMON,1)); hard=true;}
					else if (j==10 && !hard){ s.add(make_mob_event(Monster_code.MOB_FIRE_ELEMENTAL,1)); hard=true;}
					else if (j==11 && !hard){ s.add(make_mob_event(Monster_code.MOB_AIR_ELEMENTAL,1)); hard=true;}
				}
				s.add(make_pause_event(1.0,0.5));
				for (int k=1; k<=Gamestate.w.randint(1, 2); k++){
					int j = Gamestate.w.randint(1, 13);
					if (j==1) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					else if (j==2) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
					else if (j<=4 && !hard) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
					else if (j==5 && !hard) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
					else if (j==6) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
					else if (j==7) s.add(make_mob_event(Monster_code.MOB_EYE_OF_NEGATION,1));
					else if (j==8) s.add(make_mob_event(Monster_code.MOB_YOUNG_NECROMANCER,1));
					else if (j<=10 && !hard) s.add(make_mob_event(Monster_code.MOB_MAGE,1));
					else if (j==11 && !hard){ s.add(make_mob_event(Monster_code.MOB_WARLOCK,1)); hard=true;}
					else if (j==12) s.add(make_mob_event(Monster_code.MOB_VORTEX,1));
					else if (j==13 && !hard) s.add(make_mob_event(Monster_code.MOB_TIME_VORTEX,1));
				}
				s.add(make_pause_event(9999.0,2.0));
				s.add(make_gold_event(20,60));
				s.addAll(upstairs());
			}
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("This won't be the first wizard you've murdered, nor will it be the last.",null));
			s.add(make_sound_event("hmmm"));
			s.add(make_pause_event(9999.0,1.0));
			for (int i=1; i<Gamestate.w.randint(3,4); i++){
				int j = Gamestate.w.randint(1, 13);
				if (j<=2) s.add(make_mob_event(Monster_code.MOB_STONE_GOLEM,1));
				else if (j<=4) s.add(make_mob_event(Monster_code.MOB_CLAY_GOLEM,1));
				else if (j==5) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				else if (j==6) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				else if (j==7) s.add(make_mob_event(Monster_code.MOB_MAGEBANE_EYE,1));
				else if (j==8) s.add(make_mob_event(Monster_code.MOB_GUARDIAN_EYE,1));
				else if (j==9) s.add(make_mob_event(Monster_code.MOB_EYE_OF_NEGATION,1));
				else if (j==10) s.add(make_mob_event(Monster_code.MOB_VORTEX,1));
				else if (j==11) s.add(make_mob_event(Monster_code.MOB_TIME_VORTEX,1));
				else if (j<=13) s.add(make_mob_event(Monster_code.MOB_GIANT_SKELETON,1));
			}
			if (Gamestate.w.one_in(10)){
				s.add(make_mob_event(Monster_code.MOB_NECROMANCER,1));
			} else if (Gamestate.w.one_in(2)){
				s.add(make_mob_event(Monster_code.MOB_SORCERER,1));
			} else if (Gamestate.w.one_in(2)){
				s.add(make_mob_event(Monster_code.MOB_PYROMANCER,1));
			} else {
				s.add(make_mob_event(Monster_code.MOB_WIZARD_OF_THE_NORTH,1));
			}
			if (Gamestate.w.one_in(10))
				s.add(make_mob_event(Monster_code.MOB_CHEST_MIMIC,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_random_loot_event(1.0,Arrays.asList(Equipment_type_code.E_GUILDMASTER_ROBE,Equipment_type_code.E_GUILDMASTER_ROBE,Equipment_type_code.E_RED_STAFF,Equipment_type_code.E_JEWELED_STAFF)));
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
		} else if (sc==Scenario_code.SC_CRAG){
			s.add(make_other_event(Dungeon_event_code.DE_CRAG));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You start to climb the mountain.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You realise how unfit you are.",null));
			s.add(make_other_event(Dungeon_event_code.DE_CLIMB));
			s.add(make_pause_event(9999.0,2.0));
			int climbs = 0;
			while (climbs<3){
				int j = Gamestate.w.randint(1, 17);
				if (j<=4){
					s.add(make_pause_event(9999.0,3.0));
					s.add(make_message_event("You trudge upwards.",null));
					s.add(make_other_event(Dungeon_event_code.DE_CLIMB));
					s.add(make_pause_event(9999.0,0.5));
					climbs = climbs + 1;
				} else if (j<=6){
					s.add(make_pause_event(9999.0,2.0));
					s.add(make_message_event("A large rock bounces down the mountainside towards you!",null));
					s.add(make_other_event(Dungeon_event_code.DE_ROCK));
					s.add(make_pause_event(9999.0,4.0));
				}
				else if (j==7) s.add(make_mob_event(Monster_code.MOB_RAVEN,3));
				else if (j==8) s.add(make_mob_event(Monster_code.MOB_WHIRLWIND,1));
				else if (j==9) s.add(make_mob_event(Monster_code.MOB_HARPY,2));
				else if (j==10) s.add(make_mob_event(Monster_code.MOB_GIANT_WASP,3));
				else if (j<=12) s.add(make_mob_event(Monster_code.MOB_WOLF,3));
				else if (j<=14) s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
				else if (j==15) s.add(make_mob_event(Monster_code.MOB_ORC_ROCK_THROWER,3));
				else if (j==16) s.add(make_mob_event(Monster_code.MOB_WHITE_WOLF,1));
				else if (j==17) s.add(make_mob_event(Monster_code.MOB_OGRE,1));
				s.add(make_pause_event(3.0,0.5));
			}
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You have reached the top of the crag. You can see far around.",null));
			s.add(make_pause_event(9999.0,2.0));
			double d = Gamestate.w.rand.nextDouble();
			boolean elemental = false;
			if (d<0.6){
				s.add(make_mob_event(Monster_code.MOB_MANTICORE,1));
			} else if (d<0.9){
				s.add(make_mob_event(Monster_code.MOB_ROC,1));
			} else {
				s.add(make_mob_event(Monster_code.MOB_AIR_ELEMENTAL,1));
				elemental = true;
			}
			s.add(make_pause_event(9999.0,2.0));
			if (elemental){
				s.add(make_loot_event(1.0,Equipment_type_code.E_MAGIC_CARPET));
			} else {
				s.add(make_loot_event(1.0,Equipment_type_code.E_LUCKY_CHARM));
			}
			s.add(make_pause_event(2.0,null));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_EVIL_FOREST){
			s.add(make_message_event("This gnarled and blackened forest seems full of nightmarish visions.",null));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_pause_event(9999.0,2.0));
			for (int i=0; i<Campaignstate.randint(10,20); i++){
				int j = Campaignstate.randint(1,16);
				if (j==1){
					s.add(make_message_event("The trees seem to writhe and groan!",null));
					s.add(make_pause_event(3.0,1.0));
				} else if (j==2){
					s.add(make_message_event("You smell a horrible stench of decay!",null));
					s.add(make_pause_event(3.0,1.0));
				} else if (j==3){
					s.add(make_message_event("You wonder if this can be real or whether it is just a bad dream.",null));
					s.add(make_pause_event(3.0,1.0));
				} else if (j<=6){
					s.add(make_illusion_event(6));
					s.add(make_pause_event(6.0,2.0));
				} else if (j<=8){
					s.add(make_message_event("The forest seems haunted by evil!",null));
					s.add(make_other_event(Dungeon_event_code.DE_FEAR));
					s.add(make_pause_event(3.0,1.0));
				} else if (j<=12){
					int k = Campaignstate.randint(1,7);
					if (k==1) s.add(make_mob_event(Monster_code.MOB_GOBLIN,1));
					else if (k==2) s.add(make_mob_event(Monster_code.MOB_WOLF,1));
					else if (k==3) s.add(make_mob_event(Monster_code.MOB_SCORPION,1));
					else if (k==4) s.add(make_mob_event(Monster_code.MOB_SPECTRE,1));
					else if (k==5) s.add(make_mob_event(Monster_code.MOB_BIG_FROG,1));
					else if (k==6) s.add(make_mob_event(Monster_code.MOB_BEAR,1));
					else if (k==7) s.add(make_mob_event(Monster_code.MOB_WRAITH,1));
					s.add(make_pause_event(2.0,1.0));
				} else if (j<=16){
					int k = Campaignstate.randint(1,13);
					if (k==1) s.add(make_mob_event(Monster_code.MOB_DARK_ELF_DRUID,1));
					else if (k<=3) s.add(make_mob_event(Monster_code.MOB_BIG_SPIDER,Campaignstate.randint(1,3)));
					else if (k==4) s.add(make_mob_event(Monster_code.MOB_TROLL,1));
					else if (k==5) s.add(make_mob_event(Monster_code.MOB_OGRE,1));
					else if (k==6) s.add(make_mob_event(Monster_code.MOB_LIME_JELLY,1));
					else if (k==7) s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
					else if (k<=9) s.add(make_mob_event(Monster_code.MOB_SHADOW,2));
					else if (k<=11) s.add(make_mob_event(Monster_code.MOB_BABY_GREEN_DRAGON,1));
					else if (k==12) s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
					else if (k==13) s.add(make_mob_event(Monster_code.MOB_DRIDER,1));
					s.add(make_pause_event(4.0,2.0));
				}
			}
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You see a huge, twisted tree.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("Something is curled around it.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("It begins to uncurl, hissing malevolently.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_YOUNG_GREEN_DRAGON,1));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("It is defeated!",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You start searching through its hoard...",null));
			s.add(make_gold_event(150,250));
			s.add(make_pause_event(1.0,null));
			s.add(make_gems_event(100,500));
			s.add(make_pause_event(1.0,null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_HERO_PLATE));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_random_loot_event(1.0,loot_options(7)));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(7)));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Now perhaps the curse that has lain upon the forest can be lifted.",null));
			s.add(make_pause_event(2.0,null));
	    	s.addAll(win());
	    } else if (sc==Scenario_code.SC_RIVERSIDE){
			s.add(make_message_event("You set off to confront the Dark Elf villain.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("On the road you encounter some wandering monsters.",null));
        	s.addAll(make_encounter(6));
			s.add(make_pause_event(8.0,2.0));
        	s.addAll(make_encounter(7));
			s.add(make_pause_event(8.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
        	s.addAll(make_encounter(7));
            s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
			s.add(make_message_event("You arrive at the river and stroll along the bank.",null));
			s.add(make_sound_event("extinguish"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("It is a place of solitude.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The weeping willows droop dolorously into the dark current.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_RAVEN,1));
			s.add(make_message_event("Quoth the raven, 'Nevermore!'",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You come upon a dark figure, brooding by the stream.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("'It is too late for me to return to the Light!' he hisses.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("He leaps up and draws two swords.",null));
			s.add(make_mob_event(Monster_code.MOB_DARK_ELF_BOSS,1));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("That's put an end to his jabber!",null));
			s.add(make_pause_event(9999.0,2.0));
			if (!Campaignstate.owns_item(Equipment_type_code.E_DARK_ELF_SWORD_LEFT)){
				s.add(make_loot_event(1.0,Equipment_type_code.E_DARK_ELF_SWORD_RIGHT));
				s.add(make_pause_event(1.0,null));
				s.add(make_loot_event(1.0,Equipment_type_code.E_DARK_ELF_SWORD_LEFT));
				s.add(make_pause_event(1.0,null));
			}
			s.add(make_loot_event(1.0,Equipment_type_code.E_UNSEELIE_BOW));
			s.add(make_pause_event(1.0,null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_ELVEN_CHAIN));
			s.add(make_pause_event(1.0,null));
			s.add(make_loot_event(1.0,Equipment_type_code.E_ELVEN_BOOTS));
			s.add(make_pause_event(1.0,null));
			s.add(make_pause_event(9999.0,3.0));
	    	s.addAll(win());
	    } else if (sc==Scenario_code.SC_LANDSLIDE){
			s.add(make_message_event("Apparently there is a big landslip on the Seddon road.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You set off to see if you can help.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("On the road you encounter some wandering monsters.",null));
        	s.addAll(make_encounter(7));
			s.add(make_pause_event(8.0,2.0));
        	s.addAll(make_encounter(8));
			s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You arrive at the landslip.",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The pile of rubble is massive - no wonder the road was blocked.",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You start clambering over boulders.",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("Some odd little creatures start to appear.",null));
            for (int i=1; i<3; i++){
            	s.add(make_mob_event(Monster_code.MOB_BABY_EE,1));
            	s.add(make_pause_event(3.0,2.0));
            }
            s.add(make_pause_event(8.0,2.0));
			s.add(make_message_event("You hear a rumbling noise - the unstable debris is slipping again.",null));
			s.add(make_sound_event("submerge"));
			s.add(make_other_event(Dungeon_event_code.DE_ROCK));
			s.add(make_pause_event(4.0,4.0));
			s.add(make_other_event(Dungeon_event_code.DE_ROCK));
			s.add(make_pause_event(4.0,4.0));
			s.add(make_other_event(Dungeon_event_code.DE_ROCK));
			s.add(make_pause_event(9999.0,4.0));
            for (int i=1; i<3; i++){
            	s.add(make_mob_event(Monster_code.MOB_BABY_EE,1));
            	s.add(make_pause_event(3.0,2.0));
            }
			s.add(make_message_event("Suddenly an enormous elemental appears!",null));
	        s.add(make_mob_event(Monster_code.MOB_EE,1));
			s.add(make_sound_event("drama"));
            for (int i=1; i<3; i++){
            	s.add(make_pause_event(3.0,2.0));
            	s.add(make_mob_event(Monster_code.MOB_BABY_EE,1));
            }
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("The elemental collapses into a heap of gravel.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("It seems to you that the original landslide must have been caused by the elemental's appearance.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You head for home, planning to come back with laborers and bullock-carts to clear the roadway.",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_WATERFALL){
			s.add(make_message_event("You set off to see the pretty waterfall.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("On the road you encounter some wandering monsters.",null));
        	s.addAll(make_encounter(6));
			s.add(make_pause_event(8.0,2.0));
        	s.addAll(make_encounter(7));
			s.add(make_pause_event(8.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
        	s.addAll(make_encounter(7));
            s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
			s.add(make_message_event("You arrive at the waterfall.",null));
			s.add(make_sound_event("extinguish"));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("How charming it is, with all the little pools and rivulets!",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("But wait - something is rising out of the river...",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("Maybe it's friendly??",null));
	        s.add(make_mob_event(Monster_code.MOB_WE,1));
			s.add(make_sound_event("drama"));
            s.add(make_pause_event(9999.0,1.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("The elemental suddenly breaks up, like a giant water balloon exploding.",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have a picnic by the riverside then go back to town.",null));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_FOREST_FIRE){
			s.add(make_message_event("The forest is burning!",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("A great pall of smoke rises up. You can hear crackling, punctuated by the snapping of boughs exploding in the heat.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("You cough and splutter, before covering your faces with wet cloths.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("Frantic woodland creatures flee towards you.",null));
			for (int i=0; i<5; i++){
				int random = Campaignstate.randint(1, 7);
				if (random<=2)
					s.add(make_mob_event(Monster_code.MOB_BEAR,1));
				else if (random<=4)
					s.add(make_mob_event(Monster_code.MOB_WOLF,1));
				else if (random<=5)
					s.add(make_mob_event(Monster_code.MOB_SNAKE,1));
				else if (random<=6)
					s.add(make_mob_event(Monster_code.MOB_BAD_CAT,1));
				else if (random<=7)
					s.add(make_mob_event(Monster_code.MOB_BABY_GREEN_DRAGON,1));
				s.add(make_pause_event(3.0,1.0));
			}
            s.add(make_pause_event(9999.0,2.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("A human figure stumbles out of the smoke.",null));
			s.add(make_pause_event(2.0,null));
			s.add(make_message_event("'I lost control of it! Flee, before it destroys you all!'","mage"));
	        s.add(make_mob_event(Monster_code.MOB_MAGE,1));
			s.add(make_pause_event(8.0,2.0));
	        s.add(make_mob_event(Monster_code.MOB_FIRE_ELEMENTAL,1));
			s.add(make_sound_event("drama"));
            s.add(make_pause_event(9999.0,1.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("The elemental is suddenly snuffed out like a candle.",null));
            s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You hurriedly leave the forest, burnt and bruised.",null));
            s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("As you start towards home, villagers arrive and start trying to put the fire out.",null));
            s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_DARK_TEMPLE_1){
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOPRAY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You try sneaking in the back of the Dark Temple one night.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.addAll(locked_door());
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("But it is not long before you start encountering worshippers.",null));
			s.add(make_pause_event(9999.0,1.0));
			for (int i=0; i<Campaignstate.randint(7,9); i++){
				int k = Campaignstate.randint(1,18);
				if (k<=2) s.add(make_mob_event(Monster_code.MOB_GOBLIN,1));
				else if (k<=4){
					s.add(make_message_event("A small demon appears!",null));
					s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				}  else if (k<=6){
					s.add(make_message_event("A small demon appears!",null));
					s.add(make_mob_event(Monster_code.MOB_IMP,1));
				} else if (k<=8) s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
				else if (k<=10) s.add(make_mob_event(Monster_code.MOB_TROGLODYTE,3));
				else if (k<=12) s.add(make_mob_event(Monster_code.MOB_BIG_KOBOLD,1));
				else if (k<=15){
					s.add(make_message_event("Some temple guards arrive!",null));
					s.add(make_mob_event(Monster_code.MOB_HALBERDIER,2));
				} else if (k==16) s.add(make_mob_event(Monster_code.MOB_HALF_TROLL,1));
				else if (k==17) s.add(make_mob_event(Monster_code.MOB_DARK_ELF_SWORDSMAN,1));
				else if (k==18) s.add(make_mob_event(Monster_code.MOB_TROGLODYTE_CROSSBOWMAN,1));
				s.add(make_pause_event(4.0,2.0));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You enter the sanctum of the temple.",null));
			s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.addAll(door());
			s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,1));
			s.add(make_mob_event(Monster_code.MOB_GOBLIN,1));
			s.add(make_mob_event(Monster_code.MOB_HALBERDIER,1));
			s.add(make_message_event("Three priests run in and tell you to surrender.",null));
			s.add(make_pause_event(2.0,1.0));
			s.add(make_message_event("Naturally you refuse.",null));
			s.add(make_pause_event(2.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,3));
			s.add(make_pause_event(5.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
			s.add(make_pause_event(5.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_IMP,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You loot the temple's coffers!",null));
			s.add(make_gold_event(50,100));
			if (!Campaignstate.owns_item(Equipment_type_code.E_MACE_OF_CHASTISEMENT)){
				s.add(make_pause_event(1.0,null));
				s.add(make_loot_event(1.0,Equipment_type_code.E_MACE_OF_CHASTISEMENT));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You run out of the temple before anyone else comes to investigate.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("A good night's work!",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(win());
	    } else if (sc==Scenario_code.SC_DARK_TEMPLE_2){
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOPRAY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.addAll(door());
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The Dark Temple is very busy today - many worshippers have arrived for the service.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The bells are pealing out to the evil gods and you smell the reek of incense and burning sacrifices.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You encounter a crowd of worshippers.",null));
			s.add(make_pause_event(9999.0,1.0));
			for (int i=0; i<Campaignstate.randint(5,8); i++){
				int k = Campaignstate.randint(1,23);
				if (k<=2){
					s.add(make_mob_event(Monster_code.MOB_GOBLIN,2));
					s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,1));
					s.add(make_mob_event(Monster_code.MOB_QUASIT,2));
				}  else if (k<=6){
					s.add(make_mob_event(Monster_code.MOB_FOREIGN_WARRIOR,2));
					s.add(make_mob_event(Monster_code.MOB_HALBERDIER,2));
					s.add(make_mob_event(Monster_code.MOB_IMP,1));
				} else if (k<=8){
					s.add(make_mob_event(Monster_code.MOB_ORC_WARRIOR,2));
					s.add(make_mob_event(Monster_code.MOB_ORC_CHAMPION,2));
					s.add(make_mob_event(Monster_code.MOB_ORC_AGITATOR,1));
				} else if (k<=10){
					s.add(make_mob_event(Monster_code.MOB_BLACK_KNIGHT,1));
					s.add(make_mob_event(Monster_code.MOB_MAGE,1));
				} else if (k<=12){
					s.add(make_mob_event(Monster_code.MOB_OGRE,2));
					s.add(make_mob_event(Monster_code.MOB_WARLOCK,1));
				} else if (k<=14){
					s.add(make_mob_event(Monster_code.MOB_TROLL,1));
					s.add(make_mob_event(Monster_code.MOB_MINOTAUR,1));
					s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,1));
				} else if (k<=17){
					s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,3));
				} else if (k<=18){
					s.add(make_mob_event(Monster_code.MOB_BLACK_OGRE,1));
				} else if (k<=19){
					s.add(make_mob_event(Monster_code.MOB_GOBLIN,3));
					s.add(make_mob_event(Monster_code.MOB_HILL_GIANT,1));
				} else if (k<=20){
					s.add(make_mob_event(Monster_code.MOB_WINGED_SPECTRE,1));
				} else if (k<=21){
					s.add(make_mob_event(Monster_code.MOB_SNIPER,1));
				} else if (k<=22){
					s.add(make_mob_event(Monster_code.MOB_ASSASSIN,1));
				} else if (k<=23){
					s.add(make_mob_event(Monster_code.MOB_DRIDER,2));
				}
				s.add(make_pause_event(4.0,2.0));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.addAll(door());
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have entered the inner temple. The feeling of evil is strong.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,2));
			if (Gamestate.w.one_in(3))
				s.add(make_mob_event(Monster_code.MOB_WAR_TROLL,1));
			else
				s.add(make_mob_event(Monster_code.MOB_HELLHOUND,1));
			s.add(make_pause_event(8.0,2.0));
			for (int i=0; i<5; i++){
				int k = Campaignstate.randint(1,8);
				if (k==1) s.add(make_mob_event(Monster_code.MOB_CLAWED_SPECTRE,1));
				if (k==2) s.add(make_mob_event(Monster_code.MOB_BURNING_GHOST,1));
				if (k==3) s.add(make_mob_event(Monster_code.MOB_MUTE_GHOST,1));
				if (k==4) s.add(make_mob_event(Monster_code.MOB_SHADOW,1));
				if (k<=6) s.add(make_mob_event(Monster_code.MOB_IMP,1));
				if (k<=8) s.add(make_mob_event(Monster_code.MOB_QUASIT,1));
				s.add(make_pause_event(3.0,1.0));
			}
			if (Gamestate.w.one_in(3))
				s.add(make_mob_event(Monster_code.MOB_ICE_DEMON,1));
			else if (Gamestate.w.one_in(2))
				s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,3));
			else if (Gamestate.w.one_in(3))
				s.add(make_mob_event(Monster_code.MOB_HELLHOUND,2));
			else
				s.add(make_mob_event(Monster_code.MOB_MAULER,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The high priest comes forth wrathfully.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("'Who disturbs me?!' he shouts.",null));
			s.add(make_pause_event(9999.0,1.0));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_mob_event(Monster_code.MOB_DARK_PRIEST,2));
	        s.add(make_mob_event(Monster_code.MOB_DARK_BISHOP,1));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You loot the temple's coffers!",null));
			s.add(make_gold_event(100,100));
			s.add(make_gems_event(300,300));
			if (!Campaignstate.owns_item(Equipment_type_code.E_DARK_BISHOP_MACE)){
				s.add(make_pause_event(2.0,null));
				s.add(make_loot_event(1.0,Equipment_type_code.E_DARK_BISHOP_MACE));
			}
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You have desecrated the temple and killed the high priest.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You return to the town in jubilation.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.addAll(win());
	    } else if (sc==Scenario_code.SC_DESERT){
			s.add(make_message_event("You equip yourselves with water, provisions and camels and begin your trek into the desert.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_other_event(Dungeon_event_code.DE_CLIMB));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_SCORPION,2));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_WHIRLWIND,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_other_event(Dungeon_event_code.DE_CLIMB));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_mob_event(Monster_code.MOB_FOREIGN_WARRIOR,2));
			s.add(make_pause_event(2.0,null));
			s.add(make_mob_event(Monster_code.MOB_ASSASSIN,1));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_other_event(Dungeon_event_code.DE_CLIMB));
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_message_event("The lone and level sands stretch far away.",null));
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_message_event("You come to a great rock, blasted smooth by windblown sand.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("A blue speck lifts from the top of it and sweeps down towards you, growing rapidly as it comes.",null));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("It roars in challenge.",null));
			s.add(make_sound_event("roar"));
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_YOUNG_BLUE_DRAGON,1));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("It is defeated!",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You start searching through its hoard...",null));
			s.add(make_gold_event(300,500));
			s.add(make_pause_event(1.0,null));
			s.add(make_gems_event(200,600));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(8)));
			s.add(make_pause_event(1.0,null));
			s.add(make_random_loot_event(1.0,loot_options(8)));
			s.add(make_pause_event(2.0,null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You begin the long trip back through the desert.",null));
			s.add(make_pause_event(2.0,null));
			s.addAll(win());
	    } else if (sc==Scenario_code.SC_LICH){
	        s.add(make_other_event(Dungeon_event_code.DE_NOBRIBE));
			s.add(make_message_event("You trek out to the old fort.",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("The ruined fort seems deserted, but you feel a definite menace in the air as you search among the rubble.",null));
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_message_event("You find a trapdoor leading downwards.",null));
			s.add(make_pause_event(9999.0,1.0));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_message_event("This passage is guarded!",null));
			List<Monster_code> guards = Arrays.asList(Monster_code.MOB_MINOTAUR,Monster_code.MOB_GUARDIAN_EYE,Monster_code.MOB_LIME_JELLY,Monster_code.MOB_BASILISK,Monster_code.MOB_MANTICORE,Monster_code.MOB_EYE_OF_NEGATION,Monster_code.MOB_WRAITH,Monster_code.MOB_NAGA_ARCHER,Monster_code.MOB_BIG_SPIDER,Monster_code.MOB_TROLL,Monster_code.MOB_NAGA_WARRIOR,Monster_code.MOB_WIGHT,Monster_code.MOB_ORC_CHAMPION,Monster_code.MOB_OGRE,Monster_code.MOB_IMP,Monster_code.MOB_QUASIT,Monster_code.MOB_DARK_ELF_ARCHER,Monster_code.MOB_MUTE_GHOST,Monster_code.MOB_BURNING_GHOST,Monster_code.MOB_SHADOW,Monster_code.MOB_DARK_DWARF,Monster_code.MOB_MUMMY,Monster_code.MOB_BLACK_KNIGHT,Monster_code.MOB_BLACK_OGRE,Monster_code.MOB_CLAWED_SPECTRE,Monster_code.MOB_DRIDER,Monster_code.MOB_LIZARDMAN,Monster_code.MOB_GIANT_SKELETON,Monster_code.MOB_HELLHOUND,Monster_code.MOB_HILL_GIANT,Monster_code.MOB_WAR_TROLL,Monster_code.MOB_SHADOW_SPIDER,Monster_code.MOB_SHADOWCASTER);
			for (int i=1; i<=3; i++){
		        s.add(make_mob_event(guards.get(Campaignstate.randint(0,guards.size()-1)),1));
			}
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
			for (int i=1; i<=5; i++){
				s.add(make_pause_event(10.0,1.0));
		        s.add(make_mob_event(guards.get(Campaignstate.randint(0,guards.size()-1)),1));
			}
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_gold_event(200,200));
	        s.add(make_other_event(Dungeon_event_code.DE_ALIGHT));
	        s.add(make_other_event(Dungeon_event_code.DE_NOFLY));
	        s.add(make_other_event(Dungeon_event_code.DE_NOSNEAK));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("You continue downwards, seeking the source of the evil.",null));
			s.add(make_pause_event(9999.0,2.0));
	        s.addAll(downstairs());
			s.add(make_pause_event(9999.0,3.0));
			s.addAll(door());
			s.add(make_pause_event(9999.0,3.0));
            s.add(make_other_event(Dungeon_event_code.DE_TELEPORTRUNE));
			s.add(make_pause_event(9999.0,3.0));
			s.addAll(locked_door());
			s.add(make_pause_event(9999.0,3.0));
			s.add(make_mob_event(Monster_code.MOB_UNDEAD_BOSS_PHASE12,1));
			s.add(make_sound_event("drama"));
			s.add(make_message_event("You come face to face with a skeletal sorcerer. You sense it has great power.",null));
			s.add(make_pause_event(1.0,null));
			s.add(make_message_event("It lets out a grating cackle and begins to unleash a spell against you.",null));
			s.add(make_pause_event(9999.0,4.0));
			s.add(make_mob_event(Monster_code.MOB_UNDEAD_BOSS_PHASE3,1));
			s.add(make_message_event("The undead sorcerer sweeps back into the room!",null));
			s.add(make_sound_event("drama"));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_message_event("Time to press your advantage! You pursue the fleeing archvillain.",null));
			for (int i=1; i<6; i++){
				s.add(make_pause_event(9999.0,1.5));
				if (Campaignstate.one_in(2)){
					if (Campaignstate.one_in(3)) s.addAll(locked_door());
					else s.addAll(door());
				} else if (Campaignstate.one_in(2)) s.addAll(downstairs());
				else s.addAll(upstairs());
			}
			s.add(make_pause_event(9999.0,1.0));
			s.add(make_mob_event(Monster_code.MOB_UNDEAD_BOSS_PHASE4,1));
			s.add(make_sound_event("drama"));
			s.add(make_message_event("You have tracked him down to his lair!",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_sound_event("kill boss"));
			s.add(make_message_event("The undead sorcerer is defeated!",null));
			s.add(make_pause_event(9999.0,2.0));
			s.add(make_gold_event(2000,2000));
			s.add(make_gems_event(3000,3000));
			s.add(make_message_event("You have eradicated the evil lurking within the old fort.",null));
			s.add(make_pause_event(9999.0,4.0));
			s.addAll(win());
	    }
		return s;
	}
}

